Hi,
I have installed openser v1.1.0 on Linux system.
I have problem checking if "Route" header contains the "username" of Req-URI as below:
Req-URI will be like "sip:7267261000@<domain>" and Route header will be like "<sip:termdoneatscsf_7267261000@<domain>;lr>
# To get the RURI I did like this avp_write("$ru/username", "$avp(UNAMEOFRURI)"); avp_print();
# To get the Route Header, I did like this avp_write("$hdr(Route)", "$avp(ROUTEUSERNAME)"); avp_print();
Now, what is the best way to check if $avp(ROUTEUSERNAME) contains $avp(UNAMEOFRURI)?
I tried as below, and it gives error "regexp requires string value"
if(avp_check("$avp(UNAMEOFRURI)","re/$avp(ROUTEUSERNAME)/gi")) {
log(1, "Usernames of RURI is found inside Route header."); } else { log(1, "Usernames of RURI is NOT found inside Route header.");
}
Instead of avp_check, I tried to use search as below: if(search("^(Route):.*$ru/username.*")) { log(1, "Usernames of RURI is found inside Route header."); }
But, it didn't work either.
Please suggest what is the best method to do this?
Thanks, Vivek
__________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com