Let me guess you’re trying accessing the session during hangup? http://wiki.freeswitch.org/wiki/Variable_session_in_hangup_hook -- Brian West brian@freeswitch.org FreeSWITCH Solutions, LLC PO BOX 2531 Brookfield, WI 53008-2531 Twitter: @FreeSWITCH_Wire , @briankwest http://www.freeswitchbook.com http://www.freeswitchcookbook.com T: +1.918.420.9001 | F: +1.918.420.9002 | M: +1.918.424.WEST iNUM: +883 5100 1420 9001 ISN: 410*543 Skype:briankwest PGP Key: http://www.bkw.org/key.txt (AB93356707C76CED) On Dec 3, 2013, at 5:07 PM, Mark Tsai <twkid@yahoo.com> wrote:
I now have the following lines added in
lua.conf --- <param name="xml-handler-script" value="$${base_dir}/scripts/dir.lua"/> <param name="xml-handler-bindings" value="directory" />
dir.lua --- freeswitch.consoleLog("info", params:serialize("xml") .. "\n") // Do some api check here to decide allow REGISTER or not session:hangup();
I am able to see the custom header with the consoleLog on params but if I try to stop this incoming REGISTER request using the hangup() call I get FS complaining about "attempt to index global 'session' (a nil value)"
How can I go about locating this incoming REGISTER that's not a session yet?
thanks again for the help, Mark