[SR-Users] Issue using subst

Uriel Rozenbaum uriel.rozenbaum at gmail.com
Wed Aug 11 20:00:42 CEST 2010


Hi guys,

I'm having a weird situation when trying to modify some parts of the
RPID on my config file. I'm using Kamailio 1.5.3-notls

The code is the following:

...
subst('/^Remote-Party-ID:(.*)sip:(.*)@(.*)$/Remote-Party-ID:\1sip:$avp(s:ANIegress)@\3/ig');
subst('/^Remote-Party-ID:(.*)"(.*)"(.*)sip:(.*)$/Remote-Party-ID:\1"$avp(s:ANIegress)"\3sip:\4/ig');
...

With the first line I'm trying, to change the user part of the SIP-URI
to the value in $avp(s:ANIegress).
Then i just replace the token between double quotes (if any) with the
value in $avp(s:ANIegress).

But when I check the captured (ngrep) results I have the following:

Before:
Remote-Party-ID: "60911000"
<sip:541160911100 at 192.168.200.100>;privacy=off;screen=no.
After:
Remote-Party-ID: "60911000"
<sip:1160911100 at 192.168.200.100>;privacy=off;screen=no.Remote-Party-ID:
"1160911100" <sip:541160911100 at 192.168.200.100>;privacy=off;screen=no.

Can anyone point me on the direction to solve the issue, or a better
way to replace the values in RPID, PAI (and possibly From Header for
some providers)?

Thanks in advence!
Uriel



More information about the sr-users mailing list