<div dir="ltr">try<div>execute_on_answer_1<div>execute_on_answer_2<br></div></div><div>or set</div><div>leg_timeout=120</div><div>and remove first execute_on_answer</div></div><div class="gmail_extra"><br><div class="gmail_quote">2018-02-28 10:42 GMT+02:00 Francesco Facco de Lagarda <span dir="ltr"><<a href="mailto:francesco@delagarda.com" target="_blank">francesco@delagarda.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="IT" link="#0563C1" vlink="#954F72"><div class="m_-623925333492551669WordSection1"><p class="MsoNormal"><span lang="EN-US">I am developing a calling platform using javascript.<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US">I have code that calculates how long THAT user is allowed to call THAT number for.<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US">I am trying to schedule 2 events,<u></u><u></u></span></p><ol style="margin-top:0cm" start="1" type="1"><li class="m_-623925333492551669MsoListParagraph" style="margin-left:0cm"><span lang="EN-US">1 min before time ends, that plays a message “you have 1 minute left ..”<u></u><u></u></span></li><li class="m_-623925333492551669MsoListParagraph" style="margin-left:0cm"><span lang="EN-US">The actual hangup when the time expires..<u></u><u></u></span></li></ol><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US">Despite a zillion tests I have been unable to schedule BOTH events.. <u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US">This is my code: for simplicity’s sake I have set call time to 120 secs, with warning at 60:<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US">if (session.ready()) {<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New""><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New"">/***<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New"">Get user, number, etc…  code omitted for simplicity<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New"">**/<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New""><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New"">     var sessOut = new Session("sofia/gateway/ht503/" +  dialedNum + "@<a href="http://192.168.0.201:5062" target="_blank">192.168.0.201:5062</a>");<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New"">     var totTime = 60;<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New"">     sessOut.execute("set", "execute_on_answer=sched_<wbr>hangup +120 alloted_timeout")<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New"">     sessOut.execute("set", "execute_on_answer=sched_<wbr>broadcast +60 playback::" + soundDir + "one_min_left.wav both");<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New""><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New"">     if (sessOut.ready()) {<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New"">          bridge(session, sessOut);<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New"">     }<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New"">     sessOut.hangup();<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New"">     session.hangup();<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-family:"Courier New"">}<u></u><u></u></span></p></div></div><br>______________________________<wbr>______________________________<wbr>_____________<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.<wbr>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.<wbr>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.<wbr>freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/<wbr>mailman/listinfo/freeswitch-<wbr>users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank">http://lists.<wbr>freeswitch.org/mailman/<wbr>options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br></blockquote></div><br></div>