[Freeswitch-users] Can bind-meta-app hangup b-leg?

Tim St. Pierre fs-list at communicatefreely.net
Fri Sep 16 21:10:42 MSD 2011


Hello,

I'm building a little DISA application in lua, and one of the things I 
want to do is give the user the option to hang up on their current call 
and come back into the app so they can make another call without 
re-authenticating.  I was trying to use bind-meta-app to execute hangup 
on the other leg, but it doesn't seem to work.

Here's the important part of my lua script:

function place_call()
        destination = session:playAndGetDigits(3, 14, 1, 3000, 
'#','phrase:disa_enter_number','','\\d+')
        session:execute("bind_meta_app","9 a oi transfer::test-tone XML 
targets")
        freeswitch.consoleLog("info","User ".. user.." calling 
"..destination.." from DISA tool\n")
        session:execute("execute_extension",destination.." XML internal")
end

If I change the flag to be the same leg, *9 hangs up on me, but I want 
it to hang up on the other guy.

I am using execute_extension to run some dialplan that takes care of 
routing, caller ID setup, etc.  It isn't really practical to call a 
bridge from the script, since there is a lot of pre-processing to do, 
and I have it already sorted out in the dialplan.  The function is set 
to loop as long as session:ready() is true, so killing the b-leg should 
bring us back to the top of this function.

Why doesn't this work, or is there a better way to achieve the same result?

Thanks!

-Tim



Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list