[OpenSIPS-Users] regular expression matching

Gabriel Bermudez elgabo81 at gmail.com
Mon Oct 11 16:32:28 CEST 2010


Hi everyone,

I'm having trouble creating a regex in the opensips.cfg file.  This is
the snipplet

modparam("drouting", "attrs_avp", '$avp(s:dr_attrs)')
...
do_routing();
$avp(s:special) = $(avp(s:dr_attrs){param.value,special});
xlog("attrs/$avp(s:dr_attrs) special/$avp(s:special) rU/$ru
^sip:$avp(s:special)[0-9]*@");
if (uri =~ "^sip:$avp(s:special)[0-9]*@") {
    xlog("do something to the R-URI");
}

the $avp(s:dr_attrs) gets loaded with "special=742400593", so the
avp(s:special) has the value "742400593" and the the $ru variable
which I presume must have the same value of the uri variable has
"sip:74240059389999999 at a.b.c.d", but for some reason the expression is
not returning true.  What I'm doing wrong.

Regards,



More information about the Users mailing list