getting disconnect cause for a leg after bridge in Lua
Hi All, Is there any way to get a real disconnection cause for leg B in the following script ? if (session_a:ready() and session_b:ready()) then freeswitch.bridge(session_a,session_b) -- session_b gets disconnect here ... local session_b_hangup_cause = session_b:hangupCause() session_b_hangup_cause is always "SUCCESS" after debridging while log and CDR shows correct value - can get it to my script ? Thanks / Mike
No, you can't do this because the session you are checking is "gone" as soon as the call leg is disconnected. You are better off using a hangup hook or an event socket application if you need to get that value in realtime. Dialplan scripts are good for connecting endpoints and doing simple logic but they are absolutely not what you want for doing any kind of billing or reporting. -MC On Sat, Aug 13, 2011 at 2:46 AM, Mi Ke <mi.ke@null.net> wrote:
Hi All,
Is there any way to get a real disconnection cause for leg B in the following script ?
if (session_a:ready() and session_b:ready()) then
freeswitch.bridge(session_a,session_b)
-- session_b gets disconnect here ...
local session_b_hangup_cause = session_b:hangupCause()
session_b_hangup_cause is always "SUCCESS" after debridging while log and CDR shows correct value - can get it to my script ?
Thanks / Mike
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
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 (2)
-
Mi Ke
-
Michael Collins