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 mind.<br>
<br>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...<br>
<br>-MC<br><br><div class="gmail_quote">On Mon, Mar 8, 2010 at 5:30 AM, rentmycoder rentmycoder <span dir="ltr"><<a href="mailto:rentmycoder@gmail.com">rentmycoder@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi Guys,<br>
Freeswitch rocks!<br>
<br>
According to the wiki page I could use (session:bridged() to check if<br>
session is bridged...<br>
<a href="http://wiki.freeswitch.org/wiki/Lua#session:bridged" target="_blank">http://wiki.freeswitch.org/wiki/Lua#session:bridged</a><br>
if (session:bridged() == true) do<br>
-- Do something<br>
end<br>
But in latest trunk session:bridged() retuns nil...<br>
<br>
If I list the session functions like this:<br>
<a href="http://wiki.freeswitch.org/wiki/Lua#How_can_I_find_useful_undocumented_Session_Functions.3F" target="_blank">http://wiki.freeswitch.org/wiki/Lua#How_can_I_find_useful_undocumented_Session_Functions.3F</a><br>
session:bridged is not in the list...<br>
Do you plan to implement this function?<br>
<br>
How can I detect a bridge on the other leg in lua?<br>
<br>
I need this to create an automatic predictive dialer, which dials<br>
customers and if the customer picks up the phone the lua script plays<br>
a message and transfers the other leg to an operator...<br>
I start the call using event-socket api originate and bridges the<br>
customer with a loopback lua script:<br>
"api originate {originate_timeout=30,origination_caller_id_number=3812345678}sofia/gateway/provider/12345789<br>
'&lua(cc.lua predictive)'"<br>
In the lua script I would have to wait for the a-leg to bridge, how to<br>
achive this without session:bridged()?<br>
<br>
_______________________________________________<br>
FreeSWITCH-dev mailing list<br>
<a href="mailto:FreeSWITCH-dev@lists.freeswitch.org">FreeSWITCH-dev@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
</blockquote></div><br>