[Freeswitch-users] Issue with Javascript setTimeout

royj at yandex.ru royj at yandex.ru
Mon Jan 25 09:58:52 MSK 2016


have no relationship to the resource, but first link to request 'asynchronous code javascript'

http://www.hiddenwebgenius.com/blog/guides/understanding-javascripts-asynchronous-code/

25.01.2016, 09:16, "Normando Hall" <nhall at unixlan.com.ar>:
> Sorry, I missed to say it is Freeswitch 1.4
>
> El 25/01/2016 a las 02:53 a.m., Normando Hall escribió:
>>  Hello everybody.
>>
>>  I am coding a js script to do somethings, and I want to add a global
>>  timeout, to call a function to play a file and hangup. But the function
>>  called inmediatelly.
>>  Also tested with setInterval, the same behaviour.
>>
>>  function playTimeout(despedida){
>>      if (session.ready()) {
>>          logger("TIMEOUT");
>>          session.execute("playback", sonidos + "/TIMEOUT.wav");
>>          session.execute("sleep","500");
>>          logger(despedida);
>>          session.execute("playback", sonidos + "/" + despedida + ".wav");
>>          session.hangup();
>>      }
>>      exit("TIMEOUT");
>>  }
>>
>>  setTimeout(playTimeout(despedida),120000);
>>  .
>>  .
>>  .
>>  my script continue
>>
>>  Any help is welcome!
>>
>>  Thank you
>>  Normando
>>
>>  _________________________________________________________________________
>>  Professional FreeSWITCH Consulting Services:
>>  consulting at freeswitch.org
>>  http://www.freeswitchsolutions.com
>>
>>  Official FreeSWITCH Sites
>>  http://www.freeswitch.org
>>  http://confluence.freeswitch.org
>>  http://www.cluecon.com
>>
>>  FreeSWITCH-users mailing list
>>  FreeSWITCH-users at lists.freeswitch.org
>>  http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>  UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>>  http://www.freeswitch.org
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://confluence.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org



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