[Users] config file syntax
Klaus Darilion
klaus.mailinglists at pernau.at
Thu Mar 22 18:10:45 CET 2007
Scott Yagel wrote:
> Klaus,
>
> Is this syntax documented anywhere?
>
> For instance, I want to catch all 1xx (exactly 3 digits, starting with 1)
> and send them to the SEMS conference application. So would I use something
> like:
>
> if(uri =~"^sip:1[0-9]{3}@")
you need: if(uri =~"^sip:1[0-9]{2}@")
you have to learn "regular expressions". Just google for it. openser
uses POSIX regular expressions.
regards
klaus
> etc,etc
>
> Thanks,
> Scott Yagel
> PacketCall, Inc.
> syagel at packetcall.net
> -----Original Message-----
> From: Klaus Darilion [mailto:klaus.mailinglists at pernau.at]
> Sent: Wednesday, March 21, 2007 10:43 AM
> To: syagel at packetcall.net
> Cc: daniel at voice-system.ro; 'users openser.org'
> Subject: Re: [Users] config file syntax
>
>
>
> Scott Yagel wrote:
>> I'm still looking for some help in understanding the syntax used in the
> cfg
>> files, such as what the following statement fragment really is doing:
>>
>> if(uri =~"^sip:[0-9]{10}@")
>
> uri is the request URI of the request, e.g:
> INVITE sip:syagel at packetcall.net SIP/2.0
> then uri would be "sip:syagel at packetcall.net"
>
> =~ means regular expression comparison, thus the following regular
> expression will be applied and if it matches the if condition returns
> TRUE, otherwise false.
>
> ^sip:[0-9]{10}@
> this is the regular expression. The uri must start (^) with "sip:". Then
> there must be 10 digits followed by an "@". In short: the username must
> be a 10 digit phone number.
>
> regards
> klaus
>
>
More information about the sr-users
mailing list