[Freeswitch-dev] mod lua session:bridged() not implemented?

Michael Collins msc at freeswitch.org
Mon Mar 8 09:33:42 PST 2010

I think you might be looking at the wrong tool. The session:bridged() method
is for knowing if the current session is bridged to another leg. Tony says
it has a very specific use case and I doubt that this is what they had in

If you're building a predictive dialer and you are generating the outbound
call leg then you're most likely in need of knowing that the far end has
answered. In a case like this I would build a dialplan extension and have
the b leg drop in there. Then set execute_on_answer to your lua script. You
could also use that dialplan to handle timeouts, call failures, etc. This
way you're letting the dialplan do what it's good at and your Lua script can
focus on the single task of handling an answered call...


On Mon, Mar 8, 2010 at 5:30 AM, rentmycoder rentmycoder <
rentmycoder at gmail.com> wrote:

> Hi Guys,
> Freeswitch rocks!
> According to the wiki page I could use (session:bridged() to check if
> session is bridged...
> http://wiki.freeswitch.org/wiki/Lua#session:bridged
> if (session:bridged() == true) do
>    -- Do something
> end
> But in latest trunk session:bridged() retuns nil...
> If I list the session functions like this:
> http://wiki.freeswitch.org/wiki/Lua#How_can_I_find_useful_undocumented_Session_Functions.3F
> session:bridged is not in the list...
> Do you plan to implement this function?
> How can I detect a bridge on the other leg in lua?
> I need this to create an automatic predictive dialer, which dials
> customers and if the customer picks up the phone the lua script plays
> a message and transfers the other leg to an operator...
> I start the call using event-socket api originate and bridges the
> customer with a loopback lua script:
> "api originate
> {originate_timeout=30,origination_caller_id_number=3812345678}sofia/gateway/provider/12345789
> '&lua(cc.lua predictive)'"
> In the lua script I would have to wait for the a-leg to bridge, how to
> achive this without session:bridged()?
> _______________________________________________
> FreeSWITCH-dev mailing list
> FreeSWITCH-dev at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev
> http://www.freeswitch.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-dev/attachments/20100308/b98661cb/attachment-0001.html 

More information about the FreeSWITCH-dev mailing list