[Freeswitch-users] Event pick

Michael Collins msc at freeswitch.org
Wed Feb 20 20:11:46 MSK 2013


What value is in obCause when the originator cancels the call? Print the
value in the else block and find out.
-MC

On Wed, Feb 20, 2013 at 4:37 AM, Archana Venugopan
<a.venugopan at mundio.com>wrote:

>  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 at 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 at 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 at fsfailover.uk01.com [CS_EXECUTE] [ORIGINATOR_CANCEL]****
>
> ** **
>
> Regards,****
>
> Archana****
>
> ** **
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> 
> 
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>
> 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
>
>


-- 
Michael S Collins
Twitter: @mercutioviz
http://www.FreeSWITCH.org
http://www.ClueCon.com
http://www.OSTAG.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20130220/125a1dac/attachment-0001.html 


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