[Freeswitch-users] How to track call changes while running javascript?

Thomas lists at virtues.net
Sun Aug 2 01:34:21 MSD 2015


I should probably mention that the JS is called with execute_on_originate, but with the :: syntax that's supposed to 
fork it into the background.

<action application="export" data="nolocal:execute_on_originate=javascript::paDial.js ${destination_number}"/>

On 01.08.2015 17:53, Thomas wrote:
> Hello list!
>
> Does anyone know if there is a way to track changes to the call state, most notably a hangup, while executing
> Javascript? We're using JS to set up a call on a device connected to Freeswitch through portaudio. That call is
> initiated with sip/sofia executing the JS in the dialplan. If the SIP leg hangs up while the JS is running, nothing
> happens until the JS terminates.
>
> I wanted to check from the script, but haven't found a way to do that. "session.state" doesn't change, hangup hook
> doesn't fire, and without setTimeout or something similar I didn't find a way to "background" the JS.
>
> Is there any way to detect a hangup during JS execution?
>
> Cheers!
>
> Thomas
>



Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list