[Freeswitch-users] unable to check hangup cause in lua

Brian West brian at freeswitch.org
Mon Jul 22 18:45:54 MSD 2013


https://wiki.freeswitch.org/wiki/Variable_session_in_hangup_hook

Em Jul 18, 2013, às 5:36 AM, Vincent Xia <gmangudai at gmail.com> escreveu:

> the scenario is Alice calls Bob and Alice hangs up before Bob answers the call,
> while using the default dialplan as
> <action application="bridge" data="user/${dialed_extension}@${domain_name}" />
> Bob instantly goes hangup after Alice hung up,
> 
> but after change the dialplan to have a lua script process the bridging, as
> <action application="lua" data="bridge.lua $1" />  // $1 is the destination_number
> Bob will still be ringing for quite a long time, the bridge.lua is simple:
> 
> dest = argv[1]
> 
> session:execute("set", "hangup_after_bridge=true");
> dial_string = string.format('user/%s', dest)
> sessionB = freeswitch.Session(dial_string)
> 
> if sessionB:ready() then
> 	freeswitch.bridge(session, sessionB);
> else
> 	freeswitch.consoleLog("info", "---session NOT ready \n ")
> 	-- ORININATOR_CANCEL can be checked here though omitted for simplicity
> 	session:hangup();
> end
> 
> why the bridge.lua is not able to respond to ORININATOR_CANCEL after Alice hangs up?
> 
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
> 
> 
> 
> 
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
> 
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org




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