[OpenSIPS-Users] Regular expression

Ivan Milivojevic edesibe at googlemail.com
Mon Aug 29 22:18:52 CEST 2011


Hello everybody,

I have one issue regarding regular expressions. I am using opensips 1.7 with
default script. I found a very weird situation in the opensips.

As I understand:

	uri=~"^sip:[2-9][0-9]{5,}@" ==> will match digits 2 to 9,0-9 and the
minimum of 5 digits after, for example, number 20212019.

But, if I am using the similar code: 

	uri=~"^sip:0[1-6][0-9]{5,}@" ==> this code is supposed to match 0,
numbers 1 to 6, one digit 0 to 9 and the minimum of 5 digits after

for uri matching I have some trouble, because opensips doesn't process uri
very well. Although in the log I can see that uri seems all right, opensips
replies with "Not found". I tried to call my cell phone with 0653227064.

I tried also this uri matching:

	uri=~"^sip:0[1-6][0-9]*@"
	uri=~"^sip:0[1-6]{7,}@"
	uri=~"^sip:0[1-6]{8,}@"

Also, the result is "Not found". I followed instructions on
http://www.visibone.com/regular-expressions/ for uri matching.
Finally, after several hours, I got my working code: 

	uri=~"^sip:06[0-9]*@.*"

But I don't understand why the other codes don't work. Can someone please
tell me where I went wrong.

Best regards,

Ivan




More information about the Users mailing list