[Freeswitch-users] non-blocking bridge in Lua

Avi Marcus avi at avimarcus.net
Fri Jul 15 02:48:05 MSD 2011


Some options:
You can set an execute_on_answer on the leg B to run your new lua script
http://wiki.freeswitch.org/wiki/Variable_execute_on_answer

<http://wiki.freeswitch.org/wiki/Variable_execute_on_answer>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.

-Avi Marcus


On Fri, Jul 15, 2011 at 1:31 AM, Mi Ke <mi.ke at null.net> wrote:

>  Hi all !
>
> 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).
>
> 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("bgapi bridge legB_session
> legA_session") 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's active.
>
> 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 ?
>
> Thanks in advance for yours hints/responses
>
> Mike
>
>
> _______________________________________________
> Join us at ClueCon 2011, Aug 9-11, Chicago
> http://www.cluecon.com 877-7-4ACLUE
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20110715/010b4c87/attachment.html 


More information about the FreeSWITCH-users mailing list