[Freeswitch-users] FW: Event pick

Archana Venugopan a.venugopan at mundio.com
Wed Feb 20 20:33:33 MSK 2013


Hi,

I should define a obsession before going to obcause. But my outbound call is already initiated from my dialplan XML [<action application="bridge" data="sofia/external/0${msc_prefix}$1$2 at 10.30.3.27<mailto:2 at 10.30.3.27>"/>].
Am not sure how to give obsession in lua script as my outbound call is initiated from dialplan XML.
Can you please guide me. Many thanks


From: freeswitch-users-bounces at lists.freeswitch.org [mailto:freeswitch-users-bounces at lists.freeswitch.org] On Behalf Of Michael Collins
Sent: 20 February 2013 17:12
To: FreeSWITCH Users Help
Subject: Re: [Freeswitch-users] Event pick

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<mailto: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<mailto: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<mailto:sofia/external/0$%7bmsc_prefix%7d$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<http://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<mailto:206 at fsfailover.uk01.com> [CS_EXECUTE] [ORIGINATOR_CANCEL]

Regards,
Archana


_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting at freeswitch.org<mailto: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<mailto: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/ae02622e/attachment.html 


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