[Freeswitch-users] Lua script session issues
nycphoneservice
nycphoneservice at gmail.com
Tue May 25 11:44:06 UTC 2021
Hi all,
I have the following issue in my lua script.
I need to initialize a new session, set variables and then originate a call
later.
It doesn't work - I get a session uninitialized error.
The lua script is called from cli as luarun test.lua
Here is the script:
ses = freeswitch.Session()
ses:execute("set","test=123") <-- get a session uninitialized
When I try ses = new freeswitch.Session() I get function overload error
It works only when I use ses = freeswitch.Session("{api_hangup_hook='lua
retry.lua',continue_on_error=true}/sofia/profile/gateway1/number|/sofia/profile/gateway2/number")
But the problem is that I have a session hangup hook specified and use
multiple gateways dial failover.
The session executes the hangup hook if the first gateway call didn't go
through, which doesn't make sense.
continue_on_error is ignored even if I do
ses:execute("set","continue_on_error=true") after the initialization.
Please suggest what is the best approach.
Thank you
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20210525/8edf8c1d/attachment.html>
More information about the FreeSWITCH-users
mailing list