<div dir="ltr">Hi all,<div>I've been banging my head on the table with this one and hoping someone has some insight here.</div><div>I'm trying to use a variable as the host & port input in t_relay() - t_relay(host, port)</div><div><br></div><div>This works fine if statically set:</div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="monospace">t_relay("10.0.1.1", "5060");</font></div></blockquote><div><br></div><div><font face="arial, sans-serif">But if I change the host or the port to a variable like this:</font></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="monospace">$avp(</font>destip<font face="monospace">) = "10.0.1.1";<br></font></div><div><font face="monospace">     $avp(dstport) = "5060";</font></div><div><font face="monospace">t_relay($avp(</font>destip<font face="monospace">), $avp(dstport));</font></div></blockquote><div><br></div><div>Then Kamailio fails to start, calling out the t_relay line:</div><div><font face="monospace">kamailio: CRITICAL: <core> [core/cfg.y:3686]: yyerror_at(): parse error in config file /etc/kamailio/kamailio-routelogic.cfg, line 62, column 35: bad command</font><br></div><div><br></div><div>I get the same behavior with pseudovariables and vars as well:</div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="monospace">$var(destip) = "10.0.1.1";</font></div><div><font face="monospace">       $var(dstport) = "5060";</font></div><div><font face="monospace">    t_relay($var(destip), $var(dstport))</font></div></blockquote><div><br></div><div>Any tips or pointers would be much appreciated.</div><div>Thanks!</div><div><br></div><div>Nick</div></div>