<div dir="ltr">try using the 1 liner sched_broadcast <a href="https://freeswitch.org/confluence/display/FREESWITCH/mod_dptools%3A+sched+broadcast">https://freeswitch.org/confluence/display/FREESWITCH/mod_dptools%3A+sched+broadcast</a><div><br></div><div>The below will schedule a broadcast to play /tmp/hangupfile.mp3 to both legs after 60 seconds. </div><div><br></div><div><i>maxTimeTaskID = </i><i>session.execute("sched_broadcast", "+60 playback!normal_clearing::/tmp/hangupfile.mp3 both")</i>;<br></div><div><br></div><div>If you find you need to cancel the broadcast use:</div><div><br></div><div><i>session.execute("sched_cancel",maxTimeTaskID);</i><br></div><div><br></div><div>hope this helps.</div><div><br></div><div>thanks</div><div>Matt</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 25 January 2016 at 06:58, <span dir="ltr"><<a href="mailto:royj@yandex.ru" target="_blank">royj@yandex.ru</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">have no relationship to the resource, but first link to request 'asynchronous code javascript'<br>
<br>
<a href="http://www.hiddenwebgenius.com/blog/guides/understanding-javascripts-asynchronous-code/" rel="noreferrer" target="_blank">http://www.hiddenwebgenius.com/blog/guides/understanding-javascripts-asynchronous-code/</a><br>
<br>
25.01.2016, 09:16, "Normando Hall" <<a href="mailto:nhall@unixlan.com.ar">nhall@unixlan.com.ar</a>>:<br>
<div class="HOEnZb"><div class="h5">> Sorry, I missed to say it is Freeswitch 1.4<br>
><br>
> El 25/01/2016 a las 02:53 a.m., Normando Hall escribió:<br>
>> Hello everybody.<br>
>><br>
>> I am coding a js script to do somethings, and I want to add a global<br>
>> timeout, to call a function to play a file and hangup. But the function<br>
>> called inmediatelly.<br>
>> Also tested with setInterval, the same behaviour.<br>
>><br>
>> function playTimeout(despedida){<br>
>> if (session.ready()) {<br>
>> logger("TIMEOUT");<br>
>> session.execute("playback", sonidos + "/TIMEOUT.wav");<br>
>> session.execute("sleep","500");<br>
>> logger(despedida);<br>
>> session.execute("playback", sonidos + "/" + despedida + ".wav");<br>
>> session.hangup();<br>
>> }<br>
>> exit("TIMEOUT");<br>
>> }<br>
>><br>
>> setTimeout(playTimeout(despedida),120000);<br>
>> .<br>
>> .<br>
>> .<br>
>> my script continue<br>
>><br>
>> Any help is welcome!<br>
>><br>
>> Thank you<br>
>> Normando<br>
>><br>
>> _________________________________________________________________________<br>
>> Professional FreeSWITCH Consulting Services:<br>
>> <a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
>> <a href="http://www.freeswitchsolutions.com" rel="noreferrer" target="_blank">http://www.freeswitchsolutions.com</a><br>
>><br>
>> Official FreeSWITCH Sites<br>
>> <a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
>> <a href="http://confluence.freeswitch.org" rel="noreferrer" target="_blank">http://confluence.freeswitch.org</a><br>
>> <a href="http://www.cluecon.com" rel="noreferrer" target="_blank">http://www.cluecon.com</a><br>
>><br>
>> FreeSWITCH-users mailing list<br>
>> <a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
>> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
>> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
>> <a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
><br>
> _________________________________________________________________________<br>
> Professional FreeSWITCH Consulting Services:<br>
> <a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
> <a href="http://www.freeswitchsolutions.com" rel="noreferrer" target="_blank">http://www.freeswitchsolutions.com</a><br>
><br>
> Official FreeSWITCH Sites<br>
> <a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
> <a href="http://confluence.freeswitch.org" rel="noreferrer" target="_blank">http://confluence.freeswitch.org</a><br>
> <a href="http://www.cluecon.com" rel="noreferrer" target="_blank">http://www.cluecon.com</a><br>
><br>
> FreeSWITCH-users mailing list<br>
> <a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
> <a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
<br>
_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" rel="noreferrer" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://confluence.freeswitch.org" rel="noreferrer" target="_blank">http://confluence.freeswitch.org</a><br>
<a href="http://www.cluecon.com" rel="noreferrer" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a></div></div></blockquote></div><br></div>