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 <[email protected]> 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 <[email protected]<mailto:[email protected]>> 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
_______________________________________________ Users mailing list [email protected] http://lists.opensips.org/cgi-bin/mailman/listinfo/users
