Can bind-meta-app hangup b-leg?
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
Sorry, looks like I sent the wrong code. That was just for testing. function place_call() destination = session:playAndGetDigits(3, 14, 1, 3000, '#','phrase:disa_enter_number','','\\d+') session:execute("bind_meta_app","9 a oi hangup::") freeswitch.consoleLog("info","User ".. user.." calling "..destination.." from DISA tool\n") session:execute("execute_extension",destination.." XML internal") end This is what I think should let me hangup on the other leg. Tim St. Pierre wrote:
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
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
participants (1)
-
Tim St. Pierre