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><action application="transfer" data="data_dip"/><br><br>Create a new extension like this:<br><br><extension name="data dip"><br>
<condition field="destination_number" expression="^data_dip$"><br> <action application="ring_ready"/> <!-- or maybe pre_answer (?) --><br> <action application="lua" data="get_customer_info.lua ${case_number}"/><br>
<action application="answer"/><br> ... do whatever you need to do with the call after the data dip<br> </condition><br></extension><br><br>The theory is that the "please hold while we look up your info..." sound is the "transfer ringback" sound. The target extension "data_dip" then "rings" while it's looking up the info and then "answers" after the lookup is complete.<br>
<br>I didn'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"><<a href="mailto:jaykris@gmail.com" target="_blank">jaykris@gmail.com</a>></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 "ideas" can be of any use to me( I know I am trying clutch at straws, but hope is eternal :))</div>
<div>1. Use "bgapi". Although on the wiki I only see this used with "originate".</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'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"><<a href="mailto:msc@freeswitch.org" target="_blank">msc@freeswitch.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The problem you'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'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"><<a href="mailto:jaykris@gmail.com" target="_blank">jaykris@gmail.com</a>></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> <extension name="MyExtension"></div><div> <condition field="destination_number" expression="9005"></div>
<div> <action application="answer"/></div><div> <action application="play_and_get_digits" data="4 16 3 7000 # phrase:MyPrompt phrase:My_invalid_entry case_number \d+" /></div>
<div> <action application="playback" data="phrase:wait_msg" /></div><div> <action application="sched_broadcast" data="+0 playback::/tmp/WPJ_MUSIC_QUEUE_4.wav"/> </div>
<div> <action application="lua" data="get_customer_info.lua ${case_number}" /></div><div> </condition></div><div> </extension></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"><<a href="mailto:avi@avimarcus.net" target="_blank">avi@avimarcus.net</a>></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'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"><<a href="mailto:jaykris@gmail.com" target="_blank">jaykris@gmail.com</a>></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>