Is this any use? http://wiki.freeswitch.org/wiki/Mod_lua#Special_Case:_env_object -Steve On 4 August 2011 10:03, Isaac Jurado <ijurado@econcept.es> wrote:
On Wed, Aug 3, 2011 at 7:56 PM, Avi Marcus <avi@avimarcus.net> wrote:
If the channel is hung up, then it's hung up.. that's what the hangup hook is, afaik. If you look at the wiki page for this: http://wiki.freeswitch.org/wiki/Variable_session_in_hangup_hook it only says that you can "access" the variable, not that the channel still exists or that you can set them.
Ok. I still have some problems with this. My dialplan contains the following:
<action application="export" data="session_in_hangup_hook=true"/> <action application="export" data="api_hangup_hook=luarun transfer_check.lua ${uuid}"/>
The transfer_check.lua script is the following:
session = freeswitch.Session(argv[1]) local cause = session:hangupCause()
if cause == "ATTENDED_TRANSFER" or cause == "BLIND_TRANSFER" then api = freeswitch.API() api.execute("log", "NOTICE Transfer detected, billsec is " .. session:getVariable("billsec")) end
The problem is that, as already discussed, the channel no longer exists so the UUID is not referring to anything.
Basically, my question is: How do you obtain the session object in a hangup hook?
Cheers.
-- Isaac Jurado Internet Busines Solutions eConcept
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org