You could use mod_fifo with the chimelist configured and avoid trying to replicate this manually.<br><br>you can certainly do it from ESL because you have a socket connection to the channel and all the commands you send will be in the background.<br>
<br><br><div class="gmail_quote">On Thu, Mar 18, 2010 at 4:02 PM, Tjardick van der Kraan <span dir="ltr">&lt;<a href="mailto:tjardick@vanderkraan.net">tjardick@vanderkraan.net</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div style="word-wrap: break-word;">Hi Anthony,<div><br></div><div>Thanks for the quick and detailed reply.</div><div><br></div><div>Could i pick your brain on the last remark, what i&#39;d like to do is:</div><div><br></div>
<div>- play a configurable time of hold music (30 seconds in the example) but this will be a variable later</div><div>- play a message (and optionally detect dtmf if needed)</div><div>- if no dtmf then continue music</div>
<div><br></div><div>and loop the above.</div><div><br></div><div>So basically creating an inbound holding point for people to wait before their call is answered, but give them the option to leave the &#39;queue&#39; to direct them else where.</div>
<div><br></div><div>Would in the async ESL i be able to stop the stream of music or would i need to do a bridge to local/9999 and unbridge to continue when i want to? Would ESL be the best way to </div><div>do this ?</div>
<div><br></div><div>Thanks for the help so far.</div><div><br></div><div>Regards,</div><div><br></div><div>Tj</div><div><div></div><div class="h5"><div><br></div><div><br><div><div>On 18 Mar 2010, at 21:19, Anthony Minessale wrote:</div>
<br><blockquote type="cite">The script is executing in the foreground and is being executed on your channel.<br><br>You cannot tell the channel to do something else because it&#39;s already running your script so<br>it can only run something else on top of it.<br>
 <br>you have 2 choices:<br><br>1) use the socket app in async mode and external scripts with an ESL plugin.<br>2) instead of executing the script on the session launch a script in a sep thread with the current uuid<br>    ad an argument then execute park and let the script control the channel remotely<br>
 <br>Even better reconsider what you want to do and avoid working against the grain of how the existing architecture is flowing and you will have the best results.<br> <br><br><br><div class="gmail_quote">On Thu, Mar 18, 2010 at 3:02 PM, Tjardick van der Kraan <span dir="ltr">&lt;<a href="mailto:tjardick@vanderkraan.net" target="_blank">tjardick@vanderkraan.net</a>&gt;</span> wrote:<br>
 <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi.<br> <br> I&#39;m trying to create a lua script but would like a certain task (music<br>
 on hold) to be &#39;backgrounded&#39;:<br> <br> -- Loop while the call is active<br> while (session:ready() == true) do<br>    -- do something here<br>    session:execute(&quot;playback&quot;, moh)<br>    freeswitch.consoleLog(&quot;INFO&quot;,&quot;Started music on hold.\n&quot;);<br>
    -- do some stuff while playing music<br>    session:sleep(30000);<br>   -- Maybe we need a way to stop music or playback will stop<br> automatically?<br>   session:execute(&quot;playback&quot;, &quot;/sounds/we_will_answer_asap.wav&quot;)<br>
   freeswitch.consoleLog(&quot;INFO&quot;,&quot;Play&#39;ed announcement.\n&quot;);<br> end<br> <br> &quot;ofcourse&quot; currently the only thin that happens is the music and my<br> loop does not continue.<br> Is there a way to start/stop music in the background?<br>
 <br> I guess in Asterisk language i will need the command StartMusicOnHold...<br> <br> Thanks for any suggestions.<br> <br> Regards,<br> <br> Tj<br> <br> _______________________________________________<br> FreeSWITCH-users mailing list<br>
 <a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">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></div><br><br clear="all"><br>-- <br>Anthony Minessale II<br><br>FreeSWITCH <a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org/</a><br>ClueCon <a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com/</a><br>
 Twitter: <a href="http://twitter.com/FreeSWITCH_wire" target="_blank">http://twitter.com/FreeSWITCH_wire</a><br><br>AIM: anthm<br><a href="mailto:MSN%3Aanthony_minessale@hotmail.com" target="_blank">MSN:anthony_minessale@hotmail.com</a><br>
GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com" target="_blank">PAYPAL:anthony.minessale@gmail.com</a><br> IRC: <a href="http://irc.freenode.net" target="_blank">irc.freenode.net</a> #freeswitch<br><br>
FreeSWITCH Developer Conference<br><a href="mailto:sip%3A888@conference.freeswitch.org" target="_blank">sip:888@conference.freeswitch.org</a><br><a href="http://iax:guest@conference.freeswitch.org/888" target="_blank">iax:guest@conference.freeswitch.org/888</a><br>
 <a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org" target="_blank">googletalk:conf+888@conference.freeswitch.org</a><br>pstn:+19193869900<br> _______________________________________________<br>FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">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></div><br></div></div></div></div><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" 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></blockquote></div><br><br clear="all"><br>-- <br>Anthony Minessale II<br><br>FreeSWITCH <a href="http://www.freeswitch.org/">http://www.freeswitch.org/</a><br>ClueCon <a href="http://www.cluecon.com/">http://www.cluecon.com/</a><br>
Twitter: <a href="http://twitter.com/FreeSWITCH_wire">http://twitter.com/FreeSWITCH_wire</a><br><br>AIM: anthm<br><a href="mailto:MSN%3Aanthony_minessale@hotmail.com">MSN:anthony_minessale@hotmail.com</a><br>GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com">PAYPAL:anthony.minessale@gmail.com</a><br>
IRC: <a href="http://irc.freenode.net">irc.freenode.net</a> #freeswitch<br><br>FreeSWITCH Developer Conference<br><a href="mailto:sip%3A888@conference.freeswitch.org">sip:888@conference.freeswitch.org</a><br><a href="http://iax:guest@conference.freeswitch.org/888">iax:guest@conference.freeswitch.org/888</a><br>
<a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org">googletalk:conf+888@conference.freeswitch.org</a><br>pstn:+19193869900<br>