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

Brian West brian at freeswitch.org
Sun Mar 14 11:00:10 PDT 2010


Pass them as arguments to your luarun hangup hook.

/b

On Mar 14, 2010, at 12:40 PM, rentmycoder rentmycoder wrote:

> 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...
> 
> _______________________________________________
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org





More information about the FreeSWITCH-users mailing list