Sorry again!
I've found how to change it but I'm missing something maybe stupid. Having the new number to call into a variable $alias_number I can print it out as follow:
xlog("L_ERR", "MATCH USERNAME - %$alias_number - %$user_number");
I've tried to rewrite it into the if-statement using both examples:
rewriteuser("$alias_number"); OR subst_uri('/^sip:(.*)@(.*)$/sip:$alias_number@\2/');
But the URI will rewritten with the WORD "$alias_number" instead of it's value. (tried with $alias_number as well as %$alias_number).
Where I'm wrong?
Thank's!
Simon
Il 20/06/2011 14:50, Simone Felici ha scritto:
Hi again,
I've found where I can collect all infromations i need in the "INBOUND" route (called username and alias). I've saved them into two variables that I've printed out to log to confirm. Into NAT_MANGLE route I can match the uri that I should change, based on a username:
if (uri=~"^sip:MYUSERNAME@") { xlog("L_ERR", "LXLOG MATCH!!!! - %$alias_number - %$user_number"); }
It works. But I've no idea how now change the uri to use the new alias instead the old one. I.ex from original:
<sip:<MYUSERNAME>@<IP>:1032;uniq=7600673C6E68DF3228C4E238ABB24>
to
<sip:<NEWUSERNAME>@<IP>:1032;uniq=7600673C6E68DF3228C4E238ABB24>
When I'll able to edit it statically, I'll then try db_ops to change values based on some MySQL entries. For now it would great if I could simple edit the uri on a static example.
It's not so clear how to use the t_relay or whatever I could use to rewrite my new destination based on the above needs.
Any help?
Thank's a lot!
Simon
Il 17/06/2011 16:49, Simone Felici ha scritto:
Thank you for your answer. You've absolutely right on the linked ser.cfg. I send a cleaned up and indented version. It's attached. Meanwhile I'll try out a little your solution.
Thank's
Simon
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users