[OpenSIPS-Users] variables not working as expected
Stefan Carlsson
stefan.carlsson at tetab.nu
Sat Mar 23 11:36:40 UTC 2024
Tip,
If you want to use vars in the dialog, use $dlg_var()
Those are valid from create_dlg() to the last BYE
but dont forget to use loose_route() or match_dialog()
before refering to them again...
(Note: They are vslud in all the in-dialog messages such as re-invite )
Tip 2 ... Buy the book
https://www.oreilly.com/library/view/building-telephony-systems/9781785280610/
Excellent
Regards_
Stefan
________________________________
From: Prathibha B <prathibhab.tvm at gmail.com>
Sent: Saturday, 23 March 2024 12:26
To: OpenSIPS users mailling list
Subject: Re: [OpenSIPS-Users] variables not working as expected
unable to access the script variable in the route block
On Sat, 23 Mar 2024 at 15:39, Prathibha B <prathibhab.tvm at gmail.com<mailto:prathibhab.tvm at gmail.com>> wrote:
if ( !create_dialog("B") ) {
send_reply(500,"Internal Server Error");
exit;
}
else
dlg_on_answer("dlg_answered");
route[dlg_answered] {
$var(payload) = "{'type':'ANSWERED', 'from':" + $fU +", 'to':" + $tU+ "}";
}
Result:
{'type':'ANSWERED', 'from':from, 'to':to}
$fU - from URI
$tU - to URI
--
Regards,
B.Prathibha
--
Regards,
B.Prathibha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20240323/c0d09b59/attachment.html>
More information about the Users
mailing list