[Freeswitch-users] Get disconnected message
Michael Jerris
mike at jerris.com
Tue Oct 4 22:21:57 MSD 2016
If you want to look in the code… check out libs/esl/src/esl.c for the places that set handle.connected = 0; like all the goto fail cases in esl_connect_timeout. It looks like they all set handle->err to some string with details (i haven’t audited all the cases but you can check for yourself). It doesn’t look like there is a way to access that from the lua currently.. but you could add one easily enough in esl_oop.cpp to just return handle->err and print that out in the lua script. If that is a helpful tool for debugging, feel free to toss a pull request with that change.
> On Oct 3, 2016, at 6:07 PM, Antonio Silva <asilva at wirelessmundi.com> wrote:
>
> Hi all,
>
> I've a simple lua esl script to handle fs events outside the main
> program, were:
>
>
> while(con:connected() == 1) do
> -- get and act on con:events
> -- break the loop on event SERVER_DISCONNECTED or SHUTDOWN
> done
>
>
> It works quite well, but at some points the loop just breaks without the
> receiving any control event (disconnected or shutdown) and i can't
> figure out why it breaks. I got it running for 5 h...
>
> Is it possible to get the cause why con:connected() is returning 0? or
> some log i could enable?
>
>
> The scripts is running on debian 8.6 and Lua 5.2.3.
>
>
> Thanks,
> António
>
Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users
mailing list