[Freeswitch-users] lua session() is blocking...

Antonio Silva asilva at wirelessmundi.com
Mon Sep 30 16:31:13 MSD 2013


Hi all,

I was trying from a lua script call a remote destination and when it
starts ringing i want to bridged it with another destination.

The problem is that the freswitch.session is blocking and it only
returns when the call is already answer...

Is there a way, beside doing it by events, to get the complete status of
a session?


the lua script:

dialstring = "{ignore_early_media=true}loopback/100/outgoing"
session = freeswitch.Session(dialstring);
-- check if is ringing...
uuid = session:getVariable('uuid')
state = api:executeString('eval uuid:' .. uuid .. '
${Channel-Call-State}')
mlog.warning(state)
while (session:ready() == true) do 
session:sleep(500)
mlog.debug('in session')
end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20130930/2130e0fc/attachment.html 


Join us at ClueCon 2013 Aug 6-8, 2013
More information about the FreeSWITCH-users mailing list