[Freeswitch-users] Hanhup hook problem when I make a-leg only call

Kamil Nigmatullin kamil.nigmatullin at gmail.com
Wed Jun 8 10:55:40 MSD 2016


Hello,

I want to make a program, that makes a call to the user and calls my script
when it ends.

I run the following script:

dialA =
"{origination_caller_id_number="..telephone_from..",ignore_early_media=true}sofia/gateway/iskratel/"..telephone_to


while(legA:ready() and dispoA ~= "ANSWER") do
  dispoA = legA:getVariable("endpoint_disposition")
  freeswitch.consoleLog("INFO","Leg A disposition is '" .. dispoA .. "'\n")
  legA:execute("set", "api_hangup_hook=luarun autoinform_cleanup.lua");
  legA:execute("set", "session_in_hangup_hook=true");
  legA:execute("playback", "/usr/local/freeswitch/sounds/alert.wav");
  legA:execute("hangup");
end

and simple log of autoinform_cleanup.lua

dat = env:serialize()
freeswitch.consoleLog("INFO","Here's everything:\n" .. dat .. "\n")


It makes a call, but when autoinform_cleanup.lua is called
I see this in console

/usr/local/freeswitch/scripts/autoinform_cleanup.lua:1: attempt to index
global 'env' (a nil value)


-- 
Kamil Nigmatullin
Tel: 77272323748
mob: 7 (707) 2517003
Skype: kamil.nigmatullin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20160608/f2e1fae6/attachment.html 


Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list