<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">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'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 'queue' 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><br></div><div><br><div><div>On 18 Mar 2010, at 21:19, Anthony Minessale wrote:</div><br class="Apple-interchange-newline"><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'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"><<a href="mailto:tjardick@vanderkraan.net">tjardick@vanderkraan.net</a>></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'm trying to create a lua script but would like a certain task (music<br> on hold) to be 'backgrounded':<br> <br> -- Loop while the call is active<br> while (session:ready() == true) do<br> -- do something here<br> session:execute("playback", moh)<br> freeswitch.consoleLog("INFO","Started music on hold.\n");<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("playback", "/sounds/we_will_answer_asap.wav")<br> freeswitch.consoleLog("INFO","Play'ed announcement.\n");<br> end<br> <br> "ofcourse" 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">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/">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> _______________________________________________<br>FreeSWITCH-users mailing list<br><a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>http://lists.freeswitch.org/mailman/listinfo/freeswitch-users<br>UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users<br>http://www.freeswitch.org<br></blockquote></div><br></div></body></html>