[OpenSIPS-Users] Quick Regex Question.

opensipslist at encambio.com opensipslist at encambio.com
Fri Feb 19 10:56:37 CET 2010


Hello Alan,

An ven., févr 19, 2010, Alan Frisch schrieb:
>What I am trying to do is prefix a value if the inbound number
>comes in with an E164 format. I tried the following, but it seems
>to throw OpenSIPS.
>
>if(uri =~ "^sip:[2-9][0-9]+@") {
>    whatever
>}
>
There's no problem with that. It is a correct regex, and should
work fine. Why are you starting [2-9] with 2 instead of 1?

>Can a kind soul suggest the proper regex to match first number
>as [2-9] and then any (unlimited number of) second numbers.
>
Since you've gotten the regex right, it might be that you are
expeciting logic from the RURI to affect your routing when it
is another header (maybe To?) that you need to focus on. Some
commercial gateways take their forwarding values from the To
header as far as I know.

By the way it would surely be interesting for you to research
the 'is_uri_user_e164' function of OpenSIPS if you are indeed
trying to match E.164 numbers in the RURI.

Regards,
Brian



More information about the Users mailing list