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

Michael Collins msc at freeswitch.org
Tue Aug 16 04:03:28 MSD 2011


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/20110815/9c77e458/attachment.html 


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