[Freeswitch-users] getting disconnect cause for a leg after bridge in Lua
Mi Ke
mi.ke at null.net
Thu Aug 18 00:58:12 MSD 2011
I see ... Thanks, Michael
----- Original Message -----
From: Michael Collins
Sent: 08/17/11 09:33 PM
To: FreeSWITCH Users Help
Subject: Re: [Freeswitch-users] getting disconnect cause for a leg after bridge in Lua
Well, it's possible if you're using an event socket program, however if you are using a dialplan script you simply cannot bend the laws of physics to magically know what's going on with the b leg when your program is "inside" the a leg.
I recommend that you use a socket-based program if you want this level of control. A socket-based program gives you the perspective that you need: you can "oversee" multiple call legs. Just a thought...
-MC
On Wed, Aug 17, 2011 at 7:51 AM, Mi Ke < mi.ke at null.net > wrote:
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
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/2a26eb55/attachment.html
Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users
mailing list