How to track call changes while running javascript?
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
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
participants (1)
-
Thomas