[Serusers] configuring ser.cfg for ip addresses

Daniel-Constantin Mierla daniel at iptel.org
Mon May 17 13:08:46 CEST 2004


No doubt it works, in regular expression the '.' (dot) character matches 
any character except newline. So it matches the '.' (dot), too.

"labbox-a.voip.lab" used in a regular expression will match 
"labbox-a.voip.lab",  "labbox-aXvoipYlab" ...

Daniel

On 5/17/2004 12:56 PM, steve wrote:

>Hi,
>Just picked up this thread. I run 0.8.12 and don't use the escape character
>ie:
>
>#--------Match for E2 PBX##
>if (uri=~"^sip:20[0-9]@10.96.1.48") {
>        route(2);
>        break;
>};
>
>
>#--------Match for ITS-1##
>if (uri=~"^sip:30[0-9]@labbox-a.voip.lab") {
>        route(3);
>        break;
>};
>
>All seems to work ok? 
>
>  
>
>>-----Original Message-----
>>From: serusers-bounces at lists.iptel.org 
>>[mailto:serusers-bounces at lists.iptel.org] On Behalf Of 
>>Daniel-Constantin Mierla
>>Sent: Monday 17 May 2004 11:50
>>To: Amen Holmes
>>Cc: serusers at lists.iptel.org
>>Subject: Re: [Serusers] configuring ser.cfg for ip addresses
>>
>>You have to use backslash to escape in every regular 
>>expression you use, doesn't matter is IP, hostname, username ...
>>Have you seen otherwise is documentation? If so, it is an 
>>error and must be corrected.
>>
>>Daniel
>>
>>On 5/17/2004 12:37 PM, Amen Holmes wrote:
>>
>>    
>>
>>>Thanks - that makes sense.
>>>If I am using a url instead of defining the ip address, e.g. 
>>>iptel.org, why don't I need to put in the backslash to escape the . 
>>>character?
>>>
>>>*/Jan Janak <jan at iptel.org>/* wrote:
>>>
>>>    On 14-05 07:47, Amen Holmes wrote:
>>>    > I am a newbie to ser and am trying to get ser.cfg 
>>>      
>>>
>>working for a
>>    
>>
>>>    specific ip address.
>>>    >
>>>    > I am trying to get ser.cfg to pick up a specific ip 
>>>      
>>>
>>address. Do
>>    
>>
>>>    I need anything special when defining the ip address (like \
>>>    characters)?
>>>    >
>>>    > Any help would be greatly appreciated.
>>>    >
>>>    > e.g.
>>>    > route{
>>>    >
>>>    > if (uri=~"^sip:[09][0-9]*@194.xxx.xxx.xxx") {
>>>    > ........}
>>>
>>>    Yes, =~ means "match using regular expression" and the 
>>>      
>>>
>>string between
>>    
>>
>>>    quotes is supposed to be a regular expressions. 
>>>      
>>>
>>Therefore you have to
>>    
>>
>>>    escape . characters with backslash:
>>>
>>>    if (uri=~"^sip:[09][0-9]*@194\.xxx\.xxx\.xxx") {
>>>
>>>    Jan.
>>>
>>>
>>>      
>>>
>>----------------------------------------------------------------------
>>    
>>
>>>--
>>>Do you Yahoo!?
>>>SBC Yahoo! 
>>>
>>>      
>>>
>><http://pa.yahoo.com/*http://us.rd.yahoo.com/evt=24311/*http://promo.y
>>    
>>
>>>ahoo.com/sbc/>
>>>- Internet access at a great low price.
>>>
>>>
>>>-------------------------------------------------------------
>>>      
>>>
>>----------
>>    
>>
>>>-
>>>
>>>_______________________________________________
>>>Serusers mailing list
>>>serusers at lists.iptel.org
>>>http://lists.iptel.org/mailman/listinfo/serusers
>>>
>>>      
>>>
>>_______________________________________________
>>Serusers mailing list
>>serusers at lists.iptel.org
>>http://lists.iptel.org/mailman/listinfo/serusers
>>
>>______________________________________________________________
>>__________
>>This message has been checked for all known viruses by the 
>>CitC Virus Scanning Service powered by SkyLabs. For further 
>>information visit http://www.citc.it
>>
>>___
>>
>>    
>>
>
>
>
>  
>




More information about the sr-users mailing list