Is this any use?<br><br><a href="http://wiki.freeswitch.org/wiki/Mod_lua#Special_Case:_env_object">http://wiki.freeswitch.org/wiki/Mod_lua#Special_Case:_env_object</a><br><br>-Steve<br><br><br><br><br><div class="gmail_quote">

On 4 August 2011 10:03, Isaac Jurado <span dir="ltr">&lt;<a href="mailto:ijurado@econcept.es">ijurado@econcept.es</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div class="im">On Wed, Aug 3, 2011 at 7:56 PM, Avi Marcus &lt;<a href="mailto:avi@avimarcus.net">avi@avimarcus.net</a>&gt; wrote:<br>
&gt;<br>
&gt; If the channel is hung up, then it&#39;s hung up.. that&#39;s what the hangup<br>
&gt; hook is, afaik.<br>
&gt; If you look at the wiki page for this:<br>
&gt; <a href="http://wiki.freeswitch.org/wiki/Variable_session_in_hangup_hook" target="_blank">http://wiki.freeswitch.org/wiki/Variable_session_in_hangup_hook</a><br>
&gt; it only says that you can &quot;access&quot; the variable, not that the channel<br>
&gt; still exists or that you can set them.<br>
<br>
</div>Ok.  I still have some problems with this.  My dialplan contains the<br>
following:<br>
<br>
&lt;action application=&quot;export&quot; data=&quot;session_in_hangup_hook=true&quot;/&gt;<br>
&lt;action application=&quot;export&quot; data=&quot;api_hangup_hook=luarun<br>
transfer_check.lua ${uuid}&quot;/&gt;<br>
<br>
The transfer_check.lua script is the following:<br>
<br>
session = freeswitch.Session(argv[1])<br>
local cause = session:hangupCause()<br>
<br>
if cause == &quot;ATTENDED_TRANSFER&quot; or cause == &quot;BLIND_TRANSFER&quot;<br>
then<br>
    api = freeswitch.API()<br>
    api.execute(&quot;log&quot;,  &quot;NOTICE Transfer detected, billsec is &quot; ..<br>
session:getVariable(&quot;billsec&quot;))<br>
end<br>
<br>
The problem is that, as already discussed, the channel no longer exists<br>
so the UUID is not referring to anything.<br>
<br>
Basically, my question is: How do you obtain the session object in a<br>
hangup hook?<br>
<div><div></div><div class="h5"><br>
Cheers.<br>
<br>
--<br>
Isaac Jurado<br>
Internet Busines Solutions eConcept<br>
<br>
_______________________________________________<br>
Join us at ClueCon 2011, Aug 9-11, Chicago<br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a> 877-7-4ACLUE<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>
</div></div></blockquote></div><br><div style="visibility: hidden; left: -5000px; position: absolute; z-index: 9999; padding: 0px; margin-left: 0px; margin-top: 0px; overflow: hidden; word-wrap: break-word; color: black; font-size: 10px; text-align: left; line-height: 130%;" id="avg_ls_inline_popup">

</div>