[OpenSIPS-Users] regular expression matching

Bogdan-Andrei Iancu bogdan at voice-system.ro
Mon Oct 11 18:45:40 CEST 2010


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:74240059389999999 at a.b.c.d"

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:74240059389999999 at a.b.c.d", but for some reason the expression is
> not returning true.  What I'm doing wrong.
>
> Regards,
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> 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




More information about the Users mailing list