<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:"Courier New";}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
        {page:Section1;}
-->
</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="blue" vlink="purple">
<div class="Section1">
<p class="MsoNormal">Hi,<o:p></o:p></p>
<p class="MsoNormal">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@10.30.3.27"/>.<o:p></o:p></p>
<p class="MsoNormal">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 =<a href="mailto:sofia/external/0$%7bmsc_prefix%7d$1$2@10.30.3.27">sofia/external/0${msc_prefix}$1$2@10.30.3.27</a>,
this is what I should put there but we already have this in our XML.<o:p></o:p></p>
<p class="MsoNormal">Please suggest me on how should I proceed. Many thanks.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN" style="font-size:10.0pt;font-family:"Courier New"">-- Initiate an outbound call<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN" style="font-size:10.0pt;font-family:"Courier New""><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN" style="font-size:10.0pt;font-family:"Courier New"">obSession = freeswitch.Session("sofia/192.168.0.4/1002")<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN" style="font-size:10.0pt;font-family:"Courier New""><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN" style="font-size:10.0pt;font-family:"Courier New"">-- Check to see if the call was answered<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN" style="font-size:10.0pt;font-family:"Courier New""><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN" style="font-size:10.0pt;font-family:"Courier New"">if obSession:ready() then<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN" style="font-size:10.0pt;font-family:"Courier New""> -- Do something good here<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN" style="font-size:10.0pt;font-family:"Courier New""><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN" style="font-size:10.0pt;font-family:"Courier New"">else -- This means the call was not answered ... Check for the reason<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN" style="font-size:10.0pt;font-family:"Courier New""><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN" style="font-size:10.0pt;font-family:"Courier New""> local obCause = obSession:hangupCause()<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN" style="font-size:10.0pt;font-family:"Courier New""><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN" style="font-size:10.0pt;font-family:"Courier New""> freeswitch.consoleLog("info", "obSession:hangupCause() = " .. obCause )<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN" style="font-size:10.0pt;font-family:"Courier New""><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN" style="font-size:10.0pt;font-family:"Courier New""> if ( obCause == "USER_BUSY" ) then -- SIP 486<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN" style="font-size:10.0pt;font-family:"Courier New""> -- For BUSY you may reschedule the call for later<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN" style="font-size:10.0pt;font-family:"Courier New""> elseif ( obCause == "NO_ANSWER" ) then<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN" style="font-size:10.0pt;font-family:"Courier New""> -- Call them back in an hour<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN" style="font-size:10.0pt;font-family:"Courier New""> elseif ( obCause == "ORIGINATOR_CANCEL" ) then -- SIP 487<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN" style="font-size:10.0pt;font-family:"Courier New""> -- May need to check for network congestion or problems<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN" style="font-size:10.0pt;font-family:"Courier New""> else<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN" style="font-size:10.0pt;font-family:"Courier New""> -- Log these issues<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN" style="font-size:10.0pt;font-family:"Courier New""> end<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN" style="font-size:10.0pt;font-family:"Courier New"">end<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN" style="font-size:10.0pt;font-family:"Courier New""><o:p> </o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">2013-02-19 17:56:02.277173 [NOTICE] sofia.c:7082 Hangup sofia/internal/206@fsfailover.uk01.com [CS_EXECUTE] [ORIGINATOR_CANCEL]<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Regards,<o:p></o:p></p>
<p class="MsoNormal">Archana<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>