[OpenSIPS-Users] rewritehost using avp

Eldad Ran eldad at tele-concept.com
Thu Mar 4 11:57:16 CET 2010


I have to rewrite host by a value that I extract from a DB, stored in an
$avp, but the rewritehost function won't accpet it as it expects a string,
I've checked the $avp type and it is a string, is there any way to go around
this?
The Error:
Mar 2 14:45:11 [16996] CRITICAL:core:yyerror: parse error in config file,
line 377, column 19-20: syntax error
Mar 2 14:45:11 [16996] CRITICAL:core:yyerror: parse error in config file,
line 377, column 34-35: bad argument, string expected
For checking the type I get:
AVP with string id IP and having String value exists
The value of $avp(s:IP) is a valid IP address.
The opensips.cfg relevant part:
if(!avp_db_query("select value from usr_preferences where uuid='MTI' LIMIT
1","$avp(s:IP)")){
exit;
}
else {
if(is_avp_set("$avp(s:IP)/s"))
log("AVP with string id IP and having String value exists\n");
if(is_avp_set("$avp(s:IP)/n"))
log("AVP with string id IP and having Int value exists\n");
rewritehost($avp(s:IP));
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.opensips.org/pipermail/users/attachments/20100304/0d37b1ea/attachment.htm 


More information about the Users mailing list