Well, I did think of one thing that you could try. If it works it would be kind of cute:<br><br>Answer the call like you currently do, grab the digits from the caller<br>Set the transfer_ringback variable to ${hold_music} (or whatever you want them to hear)<br>
Transfer the call to another extension, like this:<br>&lt;action application=&quot;transfer&quot; data=&quot;data_dip&quot;/&gt;<br><br>Create a new extension like this:<br><br>&lt;extension name=&quot;data dip&quot;&gt;<br>
  &lt;condition field=&quot;destination_number&quot; expression=&quot;^data_dip$&quot;&gt;<br>    &lt;action application=&quot;ring_ready&quot;/&gt; &lt;!-- or maybe pre_answer (?) --&gt;<br>    &lt;action application=&quot;lua&quot; data=&quot;get_customer_info.lua ${case_number}&quot;/&gt;<br>
    &lt;action application=&quot;answer&quot;/&gt;<br>    ... do whatever you need to do with the call after the data dip<br>  &lt;/condition&gt;<br>&lt;/extension&gt;<br><br>The theory is that the &quot;please hold while we look up your info...&quot; sound is the &quot;transfer ringback&quot; sound. The target extension &quot;data_dip&quot; then &quot;rings&quot; while it&#39;s looking up the info and then &quot;answers&quot; after the lookup is complete.<br>
<br>I didn&#39;t try it so please remember that the <a href="http://wiki.freeswitch.org/wiki/Reporting_Bugs#Standard_Disclaimer">standard disclaimer</a> applies. Let us know if you make any headway on this.<br><br>-MC<br>
<br><div class="gmail_quote">On Fri, Jan 25, 2013 at 4:32 PM, JP <span dir="ltr">&lt;<a href="mailto:jaykris@gmail.com" target="_blank">jaykris@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
MC,<div>Thanks for the info. Unfortunately outbound event socket application is not an option for me right now. I was wondering if the following &quot;ideas&quot; can be of any use to me( I know I am trying clutch at straws, but hope is eternal :))</div>

<div>1. Use &quot;bgapi&quot;. Although on the wiki I only see this used with &quot;originate&quot;.</div><div>2. Can I use a conference to park the caller there while playing music on another call leg of the conference. Meanwhile can I execute the Lua script :))</div>

<div>3. Can I launch another Lua script from my original one asynchronously?</div><div>4. Can I have a start up Lua script running in the background listening for some custom events and I can have the main caller thread generate the custom event and then start playing long music file. Once the background Lua script is done with the data dip, it can just break the music on the other channel.</div>

<div><br></div><div>That&#39;s it from me. Someone help me from sinking... please.</div><div><br></div><div>Thanks,</div><div>-JP</div><div class="HOEnZb"><div class="h5"><div><br><br><div class="gmail_quote">On Fri, Jan 25, 2013 at 4:10 PM, Michael Collins <span dir="ltr">&lt;<a href="mailto:msc@freeswitch.org" target="_blank">msc@freeswitch.org</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The problem you&#39;re running into is that you are trying to do two different things inside of the thread that is controlling the call flow. Playing sound files and running Lua scripts are synchronous in this context. This seems more suited for an outbound event socket application. Using the event socket you can control the call while doing other things. <br>


<br>Just curious - does anyone have an ESL example of this kind of thing? The wiki could definitely use this kind of example as it is quite useful. I&#39;ll look around and see if I can find anything.<br><br>-MC<div>
<div><br><br><div class="gmail_quote">
On Fri, Jan 25, 2013 at 3:00 PM, JP <span dir="ltr">&lt;<a href="mailto:jaykris@gmail.com" target="_blank">jaykris@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<div>Avi,</div>Thanks for the response. Unfortunately that did not work. This is what I did<div><br></div><div><div><br></div><div>    &lt;extension name=&quot;MyExtension&quot;&gt;</div><div>      &lt;condition field=&quot;destination_number&quot; expression=&quot;9005&quot;&gt;</div>



<div>            &lt;action application=&quot;answer&quot;/&gt;</div><div>            &lt;action application=&quot;play_and_get_digits&quot; data=&quot;4 16 3 7000 # phrase:MyPrompt phrase:My_invalid_entry case_number \d+&quot; /&gt;</div>



<div>            &lt;action application=&quot;playback&quot; data=&quot;phrase:wait_msg&quot; /&gt;</div><div>            &lt;action application=&quot;sched_broadcast&quot; data=&quot;+0 playback::/tmp/WPJ_MUSIC_QUEUE_4.wav&quot;/&gt; </div>



<div>            &lt;action application=&quot;lua&quot; data=&quot;get_customer_info.lua ${case_number}&quot; /&gt;</div><div>       &lt;/condition&gt;</div><div>    &lt;/extension&gt;</div><div><br></div><div>The music only plays after the Lua script exits. I played around with the timer value, but that did not help either. Any other ideas?</div>



<div><br></div><div>Thanks<br>JP</div><div><br></div><br><div class="gmail_quote">On Fri, Jan 25, 2013 at 1:22 AM, Avi Marcus <span dir="ltr">&lt;<a href="mailto:avi@avimarcus.net" target="_blank">avi@avimarcus.net</a>&gt;</span> wrote:<br>



<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">ESL gives you more control, especially to execute things in parallel.<div>If you want to do it within FS, that&#39;s a little more complicated, since most things are sequential.</div>



<div><div><br></div><div>

However, if you use the async APIs, then I think it could work:</div><div>1) <a href="http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_sched_broadcast" target="_blank">sched_broadcast</a> -- schedule the playback of your file on the UUID of the channel, for +0, meaning now.</div>





<div>2) run your lua script</div><div>3) Then stop (break) the playback on that uuid: <a href="http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_break" target="_blank">break</a></div><div>4) Continue with your execution.</div>



<div><br>

</div><div>Please wikify your results and let us know how that works out!<br clear="all"><div><div dir="ltr"><span style="font-family:Verdana,Arial,Helvetica,sans-serif;font-size:small">-Avi</span></div></div><br><div class="gmail_quote">



<div><div>

On Fri, Jan 25, 2013 at 3:34 AM, JP <span dir="ltr">&lt;<a href="mailto:jaykris@gmail.com" target="_blank">jaykris@gmail.com</a>&gt;</span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div><div>

I want to do the following...<div><br></div><div>1. Play a long music file from a dialplan.</div><div>2. While the music is playing, I want to launch a Lua script to do some data dip.</div><div>3. Once the data is fetched and Lua exits, I want to interrupt the music and continue in the dialplan</div>






<div><br></div><div>How do I do this. Any sample code or pointers would be greatly appreciated.</div><div><br></div><div>Thanks</div>
<br></div></div>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com/" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com/" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org/" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com</a><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>
<br></blockquote></div><br></div></div></div>
<br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><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>
<br></blockquote></div><br></div>
<br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><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>
<br></blockquote></div><br><br clear="all"><br></div></div><span><font color="#888888">-- <br>Michael S Collins<br>Twitter: @mercutioviz<br><a href="http://www.FreeSWITCH.org" target="_blank">http://www.FreeSWITCH.org</a><br>

<a href="http://www.ClueCon.com" target="_blank">http://www.ClueCon.com</a><br>
<a href="http://www.OSTAG.org" target="_blank">http://www.OSTAG.org</a><br><br>
</font></span><br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><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>
<br></blockquote></div><br></div>
</div></div><br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" 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.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>Michael S Collins<br>Twitter: @mercutioviz<br><a href="http://www.FreeSWITCH.org" target="_blank">http://www.FreeSWITCH.org</a><br><a href="http://www.ClueCon.com" target="_blank">http://www.ClueCon.com</a><br>
<a href="http://www.OSTAG.org" target="_blank">http://www.OSTAG.org</a><br><br>