[Freeswitch-users] lua api_hangup_hook missing env?

Troy Anderson troy at tlainvestments.com
Tue Apr 20 14:30:53 PDT 2010


The wiki (http://wiki.freeswitch.org/wiki/Mod_lua#Special_Case:_env_object) refers to the env global in mod_lua when executing a lua script set by api_hangup_hook, however, in practice, I don't see env set.  Has this been changed or have I messed up somehow?  I'm using the following from within the dial plan to get it going.

<action application="set" data="api_hangup_hook=luarun recording.lua"/>
<action application="bridge" data="user/107@${domain_name}" />

Here are the global variables lua does have set:

2010-04-20 14:19:14.698522 [NOTICE] switch_cpp.cpp:1142 recording.lua: string
2010-04-20 14:19:14.698522 [NOTICE] switch_cpp.cpp:1142 recording.lua: xpcall
2010-04-20 14:19:14.698522 [NOTICE] switch_cpp.cpp:1142 recording.lua: package
2010-04-20 14:19:14.699536 [NOTICE] switch_cpp.cpp:1142 recording.lua: tostring
2010-04-20 14:19:14.699536 [NOTICE] switch_cpp.cpp:1142 recording.lua: print
2010-04-20 14:19:14.699536 [NOTICE] switch_cpp.cpp:1142 recording.lua: os
2010-04-20 14:19:14.699536 [NOTICE] switch_cpp.cpp:1142 recording.lua: unpack
2010-04-20 14:19:14.699536 [NOTICE] switch_cpp.cpp:1142 recording.lua: swig_type
2010-04-20 14:19:14.699536 [NOTICE] switch_cpp.cpp:1142 recording.lua: require
2010-04-20 14:19:14.699536 [NOTICE] switch_cpp.cpp:1142 recording.lua: getfenv
2010-04-20 14:19:14.699536 [NOTICE] switch_cpp.cpp:1142 recording.lua: setmetatable
2010-04-20 14:19:14.699536 [NOTICE] switch_cpp.cpp:1142 recording.lua: next
2010-04-20 14:19:14.699536 [NOTICE] switch_cpp.cpp:1142 recording.lua: freeswitch
2010-04-20 14:19:14.699536 [NOTICE] switch_cpp.cpp:1142 recording.lua: assert
2010-04-20 14:19:14.699536 [NOTICE] switch_cpp.cpp:1142 recording.lua: argv
2010-04-20 14:19:14.699536 [NOTICE] switch_cpp.cpp:1142 recording.lua: tonumber
2010-04-20 14:19:14.699536 [NOTICE] switch_cpp.cpp:1142 recording.lua: io
2010-04-20 14:19:14.699536 [NOTICE] switch_cpp.cpp:1142 recording.lua: rawequal
2010-04-20 14:19:14.699536 [NOTICE] switch_cpp.cpp:1142 recording.lua: collectgarbage
2010-04-20 14:19:14.699536 [NOTICE] switch_cpp.cpp:1142 recording.lua: getmetatable
2010-04-20 14:19:14.699536 [NOTICE] switch_cpp.cpp:1142 recording.lua: module
2010-04-20 14:19:14.699536 [NOTICE] switch_cpp.cpp:1142 recording.lua: rawset
2010-04-20 14:19:14.699536 [NOTICE] switch_cpp.cpp:1142 recording.lua: ipairs
2010-04-20 14:19:14.699536 [NOTICE] switch_cpp.cpp:1142 recording.lua: script_name
2010-04-20 14:19:14.699536 [NOTICE] switch_cpp.cpp:1142 recording.lua: swig_equals
2010-04-20 14:19:14.700538 [NOTICE] switch_cpp.cpp:1142 recording.lua: math
2010-04-20 14:19:14.700538 [NOTICE] switch_cpp.cpp:1142 recording.lua: debug
2010-04-20 14:19:14.700538 [NOTICE] switch_cpp.cpp:1142 recording.lua: pcall
2010-04-20 14:19:14.700538 [NOTICE] switch_cpp.cpp:1142 recording.lua: table
2010-04-20 14:19:14.700538 [NOTICE] switch_cpp.cpp:1142 recording.lua: newproxy
2010-04-20 14:19:14.700538 [NOTICE] switch_cpp.cpp:1142 recording.lua: type
2010-04-20 14:19:14.700538 [NOTICE] switch_cpp.cpp:1142 recording.lua: coroutine
2010-04-20 14:19:14.700538 [NOTICE] switch_cpp.cpp:1142 recording.lua: _G
2010-04-20 14:19:14.700538 [NOTICE] switch_cpp.cpp:1142 recording.lua: select
2010-04-20 14:19:14.700538 [NOTICE] switch_cpp.cpp:1142 recording.lua: gcinfo
2010-04-20 14:19:14.700538 [NOTICE] switch_cpp.cpp:1142 recording.lua: pairs
2010-04-20 14:19:14.700538 [NOTICE] switch_cpp.cpp:1142 recording.lua: rawget
2010-04-20 14:19:14.700538 [NOTICE] switch_cpp.cpp:1142 recording.lua: loadstring
2010-04-20 14:19:14.700538 [NOTICE] switch_cpp.cpp:1142 recording.lua: tellme
2010-04-20 14:19:14.700538 [NOTICE] switch_cpp.cpp:1142 recording.lua: _VERSION
2010-04-20 14:19:14.700538 [NOTICE] switch_cpp.cpp:1142 recording.lua: dofile
2010-04-20 14:19:14.700538 [NOTICE] switch_cpp.cpp:1142 recording.lua: setfenv
2010-04-20 14:19:14.700538 [NOTICE] switch_cpp.cpp:1142 recording.lua: load
2010-04-20 14:19:14.701584 [NOTICE] switch_cpp.cpp:1142 recording.lua: error
2010-04-20 14:19:14.701584 [NOTICE] switch_cpp.cpp:1142 recording.lua: loadfile

Thanks!
Troy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20100420/0b9e4cda/attachment.html 


More information about the FreeSWITCH-users mailing list