Tony,<div><br></div><div>Thanks for the explanation. This was indeed my concern with trying to do it from a dp script. Sid, I'm afraid you'll need to use ESL or find a girl who is not bound by the laws of physics... :)</div>
<div><br></div><div>-MC<br><br><div class="gmail_quote">On Fri, Jun 17, 2011 at 10:30 AM, Anthony Minessale <span dir="ltr"><<a href="mailto:anthony.minessale@gmail.com">anthony.minessale@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">In this case, it turns out you are asking the girl to defy physics for you.<br>
<br>
The session is executing the script code in the same thread that needs<br>
to play the audio.<br>
You cannot magically do 2 things at once in the same thread so....<br>
using ASYNC (esl) is your only choice apart from using C and threads<br>
or launching the lua script in another thread with luarun with the<br>
channel uuid as an arg so it can feed it to the constructor and send<br>
commands to it remotely which is a pretty big mess.....<br>
<br>
<br>
<br>
<br>
On Thu, Jun 16, 2011 at 4:56 PM, Sidharth Kshatriya<br>
<div><div></div><div class="h5"><<a href="mailto:sid.kshatriya@gmail.com">sid.kshatriya@gmail.com</a>> wrote:<br>
> Thanks Michael. This is quite a mainstream requirement :-) ! Not everyone<br>
> uses ESL. Is there no way we can "hack" this in Lua?<br>
><br>
> Will await your research,<br>
><br>
> Sidharth<br>
><br>
> On Thu, Jun 16, 2011 at 11:51 PM, Michael Collins <<a href="mailto:msc@freeswitch.org">msc@freeswitch.org</a>><br>
> wrote:<br>
>><br>
>> Actually, I am looking into ways to accomplish these. They are somewhat<br>
>> related to some recipes I am doing for the FS Cookbook. Please stand by.<br>
>> FYI, I am looking at an ESL-based solution, not a dialplan script. Thus far<br>
>> I have not found a viable way to do async stuff like this from a dp script<br>
>> and I'm thinking ESL is the way to go. I will report back in a bit.<br>
>> -MC<br>
>><br>
>> On Wed, Jun 15, 2011 at 9:53 PM, Sidharth Kshatriya<br>
>> <<a href="mailto:sid.kshatriya@gmail.com">sid.kshatriya@gmail.com</a>> wrote:<br>
>>><br>
>>> I am implementing an IVR using Lua in Freeswitch. In my Lua script I use<br>
>>> curl to a web service. Sometimes the response takes a long time to come<br>
>>> back. During that time period I would like to play music on hold.<br>
>>><br>
>>> I have searched the freeswitch discussion archives a lot. There seem to<br>
>>> be many suggested ways to implement music on hold from a Lua script but the<br>
>>> answers are not very clear / not really applicable to my use case. I don't<br>
>>> know what method I should use and which one is recommended.<br>
>>><br>
>>> Method 1: Transfer the call to 9664 (music on hold extension). However<br>
>>> the implementation for this solution for this does not seem to be available<br>
>>> in Lua. For example: How would I transfer the call back?<br>
>>> Method 2: Using bgapi uuid_park park the call and using uuid_broadcast<br>
>>> play an audio file. Again what do I do to unpark the call..?<br>
>>><br>
>>> Thanks,<br>
>>><br>
>>> Sidharth<br>
>>> [P.S. This is a repost, I apologize but I never got any responses on my<br>
>>> previous email. Need help! :-) ]<br>
>>><br>
>>> --<br>
>>> Sidharth Kshatriya<br>
>>> <a href="http://www.sidk.info" target="_blank">www.sidk.info</a><br>
>>><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>
>>><br>
>><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>
>><br>
><br>
><br>
><br>
> --<br>
> Sidharth Kshatriya<br>
> <a href="http://www.sidk.info" target="_blank">www.sidk.info</a><br>
><br>
><br>
</div></div>> _______________________________________________<br>
> Join us at ClueCon 2011, Aug 9-11, Chicago<br>
> <a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a> 877-7-4ACLUE<br>
<div class="im">><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>
><br>
<br>
<br>
<br>
</div>--<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">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" target="_blank">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="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org">googletalk:conf+888@conference.freeswitch.org</a><br>
pstn:+19193869900<br>
<br>
_______________________________________________<br>
Join us at ClueCon 2011, Aug 9-11, Chicago<br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a> 877-7-4ACLUE<br>
<div><div></div><div class="h5"><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>
</div></div></blockquote></div><br></div>