[Kamailio-Users] Contact field

Daniel-Constantin Mierla miconda at gmail.com
Wed Nov 19 20:29:55 CET 2008


Here is a reference site about regular expressions:
http://www.regular-expressions.info/

subst() uses POSIX compliat regexp.

Cheers,
Daniel


On 11/19/08 19:03, Alex Balashov wrote:
> I am not sure.  These are all nuances that differ among regex 
> implementations.
>
> Perhaps you need to escape the dots in the decimal IP notation, as they 
> have a meaning in regex.  Perhaps the $ end-of-line will never be 
> matched.  Different embedded regex implementations always work 
> differently;  just have to massage it until it works.
>
> Alex R.S.M wrote:
>
>   
>> I am trying to modify
>> Contact: <sip:8133740008 at 1.1.1.1;transport=udp;maddr=1.1.1.1>
>>
>> to
>> Contact: <sip:8133740008 at 2.2.2.2;transport=udp;maddr=2.2.2.2>
>>
>>
>> I am using the following statement but it doesn't work:
>>  if ( 
>> subst('/^Contact:(.*)sip:[^@]*@([a-zA-Z0-9.]+);(.*)$/contact:\12.2.2.2;\2/ig') 
>> ) {};
>>
>> Am I missing anything?
>>
>> Thanks,
>> Alex
>>
>>
>>
>>  > Date: Wed, 19 Nov 2008 11:06:53 -0500
>>  > From: abalashov at evaristesys.com
>>  > To: alex_rsm at hotmail.com
>>  > CC: users at lists.kamailio.org
>>  > Subject: Re: [Kamailio-Users] Contact field
>>  >
>>  > The various NAT traversal modules modify the Contact to suit their ends,
>>  > according to their own scheme.
>>  >
>>  > There is a module that will allow you to modify any header to anything
>>  > you want:
>>  >
>>  > http://www.kamailio.org/docs/modules/1.4.x/textops.html
>>  >
>>  >
>>  > Alex R.S.M wrote:
>>  >
>>  > > Hi,
>>  > >
>>  > > Is there a function that can modify "Contact" field in SIP header?
>>  > >
>>  > > Thanks,
>>  > > Alex
>>  > >
>>  > > 
>> ------------------------------------------------------------------------
>>  > > Windows Live Hotmail now works up to 70% faster. Sign up today.
>>  > > 
>> <http://windowslive.com/Explore/Hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_faster_112008>
>>  > >
>>  > >
>>  > > 
>> ------------------------------------------------------------------------
>>  > >
>>  > > _______________________________________________
>>  > > Users mailing list
>>  > > Users at lists.kamailio.org
>>  > > http://lists.kamailio.org/cgi-bin/mailman/listinfo/users
>>  >
>>  >
>>  > --
>>  > Alex Balashov
>>  > Evariste Systems
>>  > Web : http://www.evaristesys.com/
>>  > Tel : (+1) (678) 954-0670
>>  > Direct : (+1) (678) 954-0671
>>  > Mobile : (+1) (706) 338-8599
>>
>> ------------------------------------------------------------------------
>> Windows Live Hotmail now works up to 70% faster. Sign up today. 
>> <http://windowslive.com/Explore/Hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_faster_112008>
>>     
>
>
>   

-- 
Daniel-Constantin Mierla
http://www.asipto.com





More information about the sr-users mailing list