[OpenSIPS-Users] rewritehost() and AVP

Anton Zagorskiy a.zagorskiy at oyster-telecom.ru
Wed Nov 17 16:58:05 CET 2010


Hello.
How to pass a value to the rewritehost() function using AVP?

1. Code
$avp(i:50) = "192.168.0.01";
rewritehostport("$avp(i:50)");
route(1)

raises errors:
ERROR:core:parse_uri: bad port in uri (error at char ) in state 8) parsed:
<sip:1001@$avp(i:50>(21) /<sip:1001@$avp(i:50)> (22)
ERROR:core:parse_sip_msg_uri: bad uri <sip:1001@$avp(i:50)>

2. Code
$avp(i:50) = "192.168.0.01";
rewritehostport($avp(i:50)); # Without qoutes
route(1)

raises errors during stratup:
CRITICAL:core:yyerror: parse error in config file, line 747, column 28-38:
syntax error
CRITICAL:core:yyerror: parse error in config file, line 747, column 38-39:
bad argument, string expected



WBR, Anton Zagorskiy
VoIP Developer, Oyster Telecom
Phone.: +7 812 601-0666
Fax: +7 812 601-0593
a.zagorskiy at oyster-telecom.ru
www.oyster-telecom.ru







More information about the Users mailing list