What value is in obCause when the originator cancels the call? Print the value in the else block and find out.
-MC
Hi,
I need to capture this ORIGINATOR _CANCEL event in my lua script. From google I found the below code. But we establish our calls from dialplan XML as like this, <action application="bridge" data="sofia/external/0${msc_prefix}$1$2@10.30.3.27"/>.
Since am not that well versed in lua script, I am not sure in the place of obsession below what should I pass. As far I understood the =sofia/external/0${msc_prefix}$1$2@10.30.3.27, this is what I should put there but we already have this in our XML.
Please suggest me on how should I proceed. Many thanks.
-- Initiate an outbound call
obSession = freeswitch.Session("sofia/192.168.0.4/1002")
-- Check to see if the call was answered
if obSession:ready() then
-- Do something good here
else -- This means the call was not answered ... Check for the reason
local obCause = obSession:hangupCause()
freeswitch.consoleLog("info", "obSession:hangupCause() = " .. obCause )
if ( obCause == "USER_BUSY" ) then -- SIP 486
-- For BUSY you may reschedule the call for later
elseif ( obCause == "NO_ANSWER" ) then
-- Call them back in an hour
elseif ( obCause == "ORIGINATOR_CANCEL" ) then -- SIP 487
-- May need to check for network congestion or problems
else
-- Log these issues
end
end
2013-02-19 17:56:02.277173 [NOTICE] sofia.c:7082 Hangup sofia/internal/206@fsfailover.uk01.com [CS_EXECUTE] [ORIGINATOR_CANCEL]
Regards,
Archana
_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting@freeswitch.org
http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.com
Official FreeSWITCH Sites
http://www.freeswitch.org
http://wiki.freeswitch.org
http://www.cluecon.com
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