<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div dir="ltr"></div><div dir="ltr">Hey Nick,</div><div dir="ltr"><br></div><div dir="ltr"><font face="monospace" style="-webkit-text-size-adjust: auto; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">t_relay($avp(</font><span style="-webkit-text-size-adjust: auto; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">destip</span><font face="monospace" style="-webkit-text-size-adjust: auto; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">), $avp(dstport));</font></div><div dir="ltr"><font face="monospace" style="-webkit-text-size-adjust: auto; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);"><br></font></div><div dir="ltr"><font face="monospace" style="-webkit-text-size-adjust: auto; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">t_relay($avp(</font><span style="-webkit-text-size-adjust: auto; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">destip</span><font face="monospace" style="-webkit-text-size-adjust: auto; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">)), $avp(dstport));</font></div><div dir="ltr"><font face="monospace" style="-webkit-text-size-adjust: auto; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);"><br></font></div><div dir="ltr"><font face="monospace" style="-webkit-text-size-adjust: auto; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">Missing bracket?</font></div><div dir="ltr"><br><blockquote type="cite">On 5 Jan 2022, at 6:22 pm, Nick J <nick@nickvsnetworking.com> wrote:<br><br></blockquote></div><blockquote type="cite"><div dir="ltr"><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>
<span>__________________________________________________________</span><br><span>Kamailio - Users Mailing List - Non Commercial Discussions</span><br><span>  * sr-users@lists.kamailio.org</span><br><span>Important: keep the mailing list in the recipients, do not reply only to the sender!</span><br><span>Edit mailing list options or unsubscribe:</span><br><span>  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</span><br></div></blockquote></body></html>