what is it blocking on in the js? are you using session.ready?<span></span><br><br>On Sunday, August 2, 2015, Thomas <<a href="mailto:lists@virtues.net">lists@virtues.net</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">They both don't change/fire. :/ It's as if the JS blocks everything about that call until it terminates. The hangup does<br>
not even register in the Freeswitch log until after the script finishes. Tried it outside execute_on_originate with the<br>
normal javascript application in the XML dialplan - same effect. The whole process seems to be a single thread - which<br>
would make sense for most use cases, unfortunately just not this one. :P<br>
<br>
Is there a way to fork the JS execution into the background? Something similar to setTimout() maybe? Or even better<br>
execute a dialplan app from JS that allows outside events to catch up? I tried the sleep application instead of JS<br>
msleep, but that didn't help either.<br>
<br>
On 01.08.2015 22:05, Ken Rice wrote:<br>
> You are looking for session ready or a hanguk up hook callback see confluence for details<br>
><br>
> Sent from my iPhone<br>
><br>
>> On Aug 1, 2015, at 3:53 PM, Thomas <<a href="javascript:;" onclick="_e(event, 'cvml', 'lists@virtues.net')">lists@virtues.net</a>> wrote:<br>
>><br>
>> Does anyone know if there is a way to track changes to the call state, most notably a hangup, while executing<br>
>> Javascript? We're using JS to set up a call on a device connected to Freeswitch through portaudio. That call is<br>
>> initiated with sip/sofia executing the JS in the dialplan. If the SIP leg hangs up while the JS is running, nothing<br>
>> happens until the JS terminates.<br>
>><br>
>> I wanted to check from the script, but haven't found a way to do that. "session.state" doesn't change, hangup hook<br>
>> doesn't fire, and without setTimeout or something similar I didn't find a way to "background" the JS.<br>
>><br>
>> Is there any way to detect a hangup during JS execution?<br>
>><br>
>> Cheers!<br>
>><br>
>> Thomas<br>
>><br>
>><br>
>> _________________________________________________________________________<br>
>> Professional FreeSWITCH Consulting Services:<br>
>> <a href="javascript:;" onclick="_e(event, 'cvml', 'consulting@freeswitch.org')">consulting@freeswitch.org</a><br>
>> <a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
>><br>
>> Official FreeSWITCH Sites<br>
>> <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
>> <a href="http://confluence.freeswitch.org" target="_blank">http://confluence.freeswitch.org</a><br>
>> <a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
>><br>
>> FreeSWITCH-users mailing list<br>
>> <a href="javascript:;" onclick="_e(event, 'cvml', 'FreeSWITCH-users@lists.freeswitch.org')">FreeSWITCH-users@lists.freeswitch.org</a><br>
>> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
>> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
>> <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br>
<br>
_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="javascript:;" onclick="_e(event, 'cvml', 'consulting@freeswitch.org')">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://confluence.freeswitch.org" target="_blank">http://confluence.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="javascript:;" onclick="_e(event, 'cvml', 'FreeSWITCH-users@lists.freeswitch.org')">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
</blockquote>