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"><<a href="mailto:ijurado@econcept.es">ijurado@econcept.es</a>></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 <<a href="mailto:avi@avimarcus.net">avi@avimarcus.net</a>> wrote:<br>
><br>
> If the channel is hung up, then it's hung up.. that's what the hangup<br>
> hook is, afaik.<br>
> If you look at the wiki page for this:<br>
> <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>
> it only says that you can "access" the variable, not that the channel<br>
> 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>
<action application="export" data="session_in_hangup_hook=true"/><br>
<action application="export" data="api_hangup_hook=luarun<br>
transfer_check.lua ${uuid}"/><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 == "ATTENDED_TRANSFER" or cause == "BLIND_TRANSFER"<br>
then<br>
api = freeswitch.API()<br>
api.execute("log", "NOTICE Transfer detected, billsec is " ..<br>
session:getVariable("billsec"))<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>