[OpenSER-Users] avp_subst and regex

Zahid Mehmood zm23 at columbia.edu
Wed Aug 1 18:06:52 CEST 2007


Hi,
    I am trying to rewrite a 5 digit number to a 11 digit number by  
adding a prefix "121285".  To achieve that I use the following:


avp_subst("$avp(s:fromuri)","/^(sip:)([134][0-9]{4}@.*)/\1+121285\2/");

in openser.log   new fromuri = sip:+12128512345 at host.columbia.edu

It works fine because of the "+" after \1

This avp_subst does not work properly if the "+" is taken out.  How  
can I use "\1" followed by another digit?

avp_subst("$avp(s:fromuri)","/^(sip:)([134][0-9]{4}@.*)/\1121285\2/");

in openser.log:  new fromuri = J128512345 at host.columbia.edu


What am i doing wrong?

Thanks in advance for your help.

-- 
Zahid




More information about the Users mailing list