[Freeswitch-users] how to access session variables after hangup???

rentmycoder rentmycoder rentmycoder at gmail.com
Sun Mar 14 10:40:02 PDT 2010


Hi guys,
Freeswitch rocks!
except the documentation:(
I'm not able to figure out how to access session variables after hangup...
I try to dial out on a gateway and detect it the called party hangs up
before bridge...

bgapi originate
{ignore_early_media=true,continue_on_fail=true,bypass_media=false,hangup_after_bridge=true,originate_timeout=10,api_hangup_hook='luarun
hangup.lua ${uuid}'}sofia/gateway/phoneno &park()

I cannot access the variables using:
1. script arguments:
'luarun hangup.lua ${uuid}'}
2010-03-14 18:25:08.122511 [CRIT] switch_channel.c:759 Invalid data
(${api_hangup_hook} contains a variable)

2. session:getVariable("originate_disposition")
2010-03-14 18:31:37.042756 [ERR] mod_lua.cpp:182 hangup.lua:2: attempt
to call global 'getVar' (a nil value)

3. params:getHeader("variable_sip_req_uri")
2010-03-14 18:36:19.973939 [ERR] mod_lua.cpp:182 hangup.lua:3: attempt
to index global 'params' (a nil value)

I have asked this before on the dev list too, but Anthony didn't gave
me a clean answer here:
http://lists.freeswitch.org/pipermail/freeswitch-dev/2009-July/002491.html

"In the script you can access the data from the env event which is
automatically created for you and it
contains all the channel variables from that departed channel."

Ok, but how?????

Please help...




More information about the FreeSWITCH-users mailing list