[SR-Users] Issue using subst

Uriel Rozenbaum uriel.rozenbaum at gmail.com
Thu Aug 12 23:27:40 CEST 2010


Alex,

Takes a little more work but works perfectly. Thanks!!!

I have to be aware of calls that have 2 RPID headers (party=called and
party=calling), is you're interested I can paste the code once I'm
done coding and testisng. :)

Rgds,
Uriel

On Wed, Aug 11, 2010 at 6:41 PM, Alex Balashov
<abalashov at evaristesys.com> wrote:
> Uriel,
>
> Why not simplify the matter?
>
> 1. Extract the value(s) of the existing Remote-Party-ID header using $re.
>
> Or, if you need something other than the RPID URI, some transformation
> applied to $hdr(Remote-Party-ID).
>
> 2. remove_hf("Remote-Party-ID");
>
> 3. append_hf("Remote-Party-ID: <whatever you like!>");
>
> :)
>
> On 08/11/2010 02:00 PM, Uriel Rozenbaum wrote:
>
>> 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
>>
>> _______________________________________________
>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
>> sr-users at lists.sip-router.org
>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
>
> --
> Alex Balashov - Principal
> Evariste Systems LLC
> 1170 Peachtree Street
> 12th Floor, Suite 1200
> Atlanta, GA 30309
> Tel: +1-678-954-0670
> Fax: +1-404-961-1892
> Web: http://www.evaristesys.com/
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>



More information about the sr-users mailing list