<div dir="ltr"><div>Some options:</div>You can set an execute_on_answer on the leg B to run your new lua script<div><meta http-equiv="content-type" content="text/html; charset=utf-8"><a href="http://wiki.freeswitch.org/wiki/Variable_execute_on_answer">http://wiki.freeswitch.org/wiki/Variable_execute_on_answer</a></div>

<div><br></div><div><a href="http://wiki.freeswitch.org/wiki/Variable_execute_on_answer"></a>Or, you can schedule all this stuff in the originate string, with either execute_on_answer or export nolocal:api_on_answer=sched_transfer or the like.</div>

<div><br></div><div><div dir="ltr"><span style="font-family:Verdana, Arial, Helvetica, sans-serif"><span style="font-size:small">-Avi Marcus</span><br></span></div>
<br><br><div class="gmail_quote">On Fri, Jul 15, 2011 at 1:31 AM, Mi Ke <span dir="ltr">&lt;<a href="http://mi.ke">mi.ke</a>@<a href="http://null.net">null.net</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<span style="font-family:Verdana"><span style="font-size:12px"><div> 
        <span style="font-family:Verdana"><span style="font-size:12px">Hi all !<br> 
        <br> 
        I want to make a Lua app which will start with Leg A, collect input, initiate outbound Leg B and when it answers, periodically play decreasing series of beeps to Leg A depending on how many minutes left to disconnect (remaining time queried via odbc). <br>

 
        <br> 
        My initial idea was to issue a non-blocking bridge command after Leg B session originate returns ring-ready and then to do the rest in while loop, but the bridge called by api:executeString(&quot;bgapi bridge legB_session legA_session&quot;) just returns Job UUID without actually bridging sessions. A usual freeswitch.bridge call blocks further script execution until unbridged, disallowing me to check Leg B states when it&#39;s active.<br>

 
        <br> 
        Is there any elegant way to acheive my goals using Lua/Dialplan apps ? To create an app starting with Leg A and constantly watching for Leg B existense/states, playing corresponding feedback messages to Leg A ?<br> 
        <br> 
        Thanks in advance for yours hints/responses<br> 
        <br> 
        Mike</span></span><br> 
         </div> 
</span></span>
<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>
<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></div></div>