<div dir="ltr">Try:<div><div>cause = session:getVariable(&quot;originate_disposition&quot;)</div><div>cause2=session:getVariable(&quot;bridge_hangup_cause&quot;)</div></div><div><br></div><div>I&#39;m not exactly sure what gets into which variable... But I think I needed both because sometimes &quot;user_busy&quot; was only in the second one. I&#39;m not 100% sure...</div>

<div><br></div><div>Here&#39;s my production error script here: <a href="https://gist.github.com/4602781">https://gist.github.com/4602781</a></div><div>(if the user accessed via a the calling card IVR, it passes them back to the menu. Otherwise, it hangs up on them. Remove or keep as appropriate.)</div>

<div><br></div><div>Please share your results if you are able to make it cleaner.</div><div><br></div><div><br clear="all"><div><div dir="ltr"><span style="font-family:Verdana,Arial,Helvetica,sans-serif;font-size:small">-Avi Marcus</span><br>

BestFone</div></div>
<br><br><div class="gmail_quote">On Wed, Jan 23, 2013 at 5:18 AM, Benoit Raymond <span dir="ltr">&lt;<a href="mailto:benoit.raymond@amiconcept.com" target="_blank">benoit.raymond@amiconcept.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 lang="FR-CA" link="blue" vlink="purple"><div><p class="MsoNormal"><span lang="EN-CA">Hello,<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-CA"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-CA">Is there a way in lua to figure out why the b-leg hung up? I have an inbound call that I need to bridge so when lua is invoked, there is a session created for the inbound call and then I use session:execute(“bridge”, “the b-leg path”) and either the call is bridged or call_timeout kicks in. I need to continue my script based on the hangup cause whether the b-leg produced a NO_ANSWER, USER_BUSY or any other condition. The session:hangupCause is of no use since my session is still active.<u></u><u></u></span></p>

<p class="MsoNormal"><span lang="EN-CA"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-CA">I found the variable “bridge_hangup_cause” on the wiki but it returns nil if I do session:getVariable(“bridge_hangup_cause”).<u></u><u></u></span></p>

<p class="MsoNormal"><span lang="EN-CA"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-CA">I am using 1.3.13<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-CA"><u></u> <u></u></span></p><p class="MsoNormal">

<span lang="EN-CA">Thanks much.<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-CA"><u></u> <u></u></span></p><p class="MsoNormal"><b><span lang="EN-CA">Benoit Raymond</span></b><span lang="EN-CA"><u></u><u></u></span></p>

<p class="MsoNormal"><span lang="EN-CA">AMI Concept Inc.<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-CA">Business VoIP Solutions / Web Design<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-CA">Phone: <a href="tel:(450) 553-1231" value="+14505531231" target="_blank">(450) 553-1231</a><u></u><u></u></span></p>

<p class="MsoNormal"><span lang="EN-CA" style="font-size:10.0pt"><a href="http://www.amiconcept.com/" target="_blank">http://www.amiconcept.com</a><u></u><u></u></span></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></div></div>