What value is in obCause when the originator cancels the call? Print the value in the else block and find out.<br>-MC<br><br><div class="gmail_quote">On Wed, Feb 20, 2013 at 4:37 AM, Archana Venugopan <span dir="ltr">&lt;<a href="mailto:a.venugopan@mundio.com" target="_blank">a.venugopan@mundio.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div link="blue" vlink="purple" lang="EN-GB">
<div>
<p class="MsoNormal">Hi,<u></u><u></u></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, &lt;action application=&quot;bridge&quot; data=&quot;sofia/external/0${msc_prefix}$1$<a href="mailto:2@10.30.3.27" target="_blank">2@10.30.3.27</a>&quot;/&gt;.<u></u><u></u></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" target="_blank">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.<u></u><u></u></p>
<p class="MsoNormal">Please suggest me on how should I proceed. Many thanks.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;" lang="EN">-- Initiate an outbound call<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;" lang="EN"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;" lang="EN">obSession = freeswitch.Session(&quot;sofia/<a href="http://192.168.0.4/1002" target="_blank">192.168.0.4/1002</a>&quot;)<u></u><u></u></span></p>

<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;" lang="EN"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;" lang="EN">-- Check to see if the call was answered<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;" lang="EN"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;" lang="EN">if obSession:ready() then<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;" lang="EN">    -- Do something good here<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;" lang="EN"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;" lang="EN">else    -- This means the call was not answered ... Check for the reason<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;" lang="EN"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;" lang="EN">    local obCause = obSession:hangupCause()<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;" lang="EN"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;" lang="EN">    freeswitch.consoleLog(&quot;info&quot;, &quot;obSession:hangupCause() = &quot; .. obCause )<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;" lang="EN"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;" lang="EN">    if ( obCause == &quot;USER_BUSY&quot; ) then              -- SIP 486<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;" lang="EN">       -- For BUSY you may reschedule the call for later<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;" lang="EN">    elseif ( obCause == &quot;NO_ANSWER&quot; ) then<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;" lang="EN">       -- Call them back in an hour<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;" lang="EN">    elseif ( obCause == &quot;ORIGINATOR_CANCEL&quot; ) then   -- SIP 487<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;" lang="EN">       -- May need to check for network congestion or problems<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;" lang="EN">    else<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;" lang="EN">       -- Log these issues<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;" lang="EN">    end<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;" lang="EN">end<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;" lang="EN"><u></u> <u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">2013-02-19 17:56:02.277173 [NOTICE] sofia.c:7082 Hangup sofia/internal/<a href="mailto:206@fsfailover.uk01.com" target="_blank">206@fsfailover.uk01.com</a> [CS_EXECUTE] [ORIGINATOR_CANCEL]<u></u><u></u></p>

<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Regards,<u></u><u></u></p>
<p class="MsoNormal">Archana<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>

<br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Michael S Collins<br>Twitter: @mercutioviz<br><a href="http://www.FreeSWITCH.org" target="_blank">http://www.FreeSWITCH.org</a><br><a href="http://www.ClueCon.com" target="_blank">http://www.ClueCon.com</a><br>
<a href="http://www.OSTAG.org" target="_blank">http://www.OSTAG.org</a><br><br>