[Freeswitch-users] getting disconnect cause for a leg after bridge in Lua

Mi Ke mi.ke at null.net
Wed Aug 17 18:51:31 MSD 2011


Thanks for replying, Michael.

 Meanwhile if session creation fails, such session can also be considered as disconnected and gone, however its disconnect cause can be read from session:hangupCause(). To my opinion, it would be very useful if disconnect cause could be always readable in Lua after session completion since such mechanism already exists for failed sessions.

 Thanks / Mike



----- Original Message -----
From: Michael Collins
Sent: 08/16/11 03:03 AM
To: FreeSWITCH Users Help
Subject: Re: [Freeswitch-users] getting disconnect cause for a leg after bridge in Lua

 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 at 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 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20110817/dc605ff5/attachment.html 


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