Hi Gabriel, when using regexp ops, you cannot use variables in the regexp definition.
But your I miss your logic here - if you do routing based on prefixes (do_routing() ), why do you need an extra regexp checking for that rule ? if the Rule matches, you already know that RURI looks like "sip:[email protected]" Regards, Bogdan Gabriel Bermudez wrote: > 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:[email protected]", but for some reason the expression is > not returning true. What I'm doing wrong. > > Regards, > > _______________________________________________ > Users mailing list > [email protected] > http://lists.opensips.org/cgi-bin/mailman/listinfo/users > > -- Bogdan-Andrei Iancu OpenSIPS Bootcamp 15 - 19 November 2010, Edison, New Jersey, USA www.voice-system.ro _______________________________________________ Users mailing list [email protected] http://lists.opensips.org/cgi-bin/mailman/listinfo/users
