[SR-Users] Calling t_relay([host, port]) with variables
Richard Edmands
thesirdmz at gmail.com
Wed Jan 5 09:55:30 CET 2022
Hey Nick,
t_relay($avp(destip), $avp(dstport));
t_relay($avp(destip)), $avp(dstport));
Missing bracket?
> On 5 Jan 2022, at 6:22 pm, Nick J <nick at nickvsnetworking.com> wrote:
>
>
> Hi all,
> I've been banging my head on the table with this one and hoping someone has some insight here.
> I'm trying to use a variable as the host & port input in t_relay() - t_relay(host, port)
>
> This works fine if statically set:
> t_relay("10.0.1.1", "5060");
>
> But if I change the host or the port to a variable like this:
> $avp(destip) = "10.0.1.1";
> $avp(dstport) = "5060";
> t_relay($avp(destip), $avp(dstport));
>
> Then Kamailio fails to start, calling out the t_relay line:
> 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
>
> I get the same behavior with pseudovariables and vars as well:
> $var(destip) = "10.0.1.1";
> $var(dstport) = "5060";
> t_relay($var(destip), $var(dstport))
>
> Any tips or pointers would be much appreciated.
> Thanks!
>
> Nick
> __________________________________________________________
> Kamailio - Users Mailing List - Non Commercial Discussions
> * sr-users at lists.kamailio.org
> Important: keep the mailing list in the recipients, do not reply only to the sender!
> Edit mailing list options or unsubscribe:
> * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20220105/d10c1511/attachment.htm>
More information about the sr-users
mailing list