<div dir="ltr"><div><div><div><div>Hello,<br><br></div>I want to make a program, that makes a call to the user and calls my script when it ends. <br><br></div>I run the following script: <br><br>dialA = "{origination_caller_id_number="..telephone_from..",ignore_early_media=true}sofia/gateway/iskratel/"..telephone_to<br><br> <br>while(legA:ready() and dispoA ~= "ANSWER") do<br> dispoA = legA:getVariable("endpoint_disposition")<br> freeswitch.consoleLog("INFO","Leg A disposition is '" .. dispoA .. "'\n")<br> legA:execute("set", "api_hangup_hook=luarun autoinform_cleanup.lua");<br> legA:execute("set", "session_in_hangup_hook=true");<br> legA:execute("playback", "/usr/local/freeswitch/sounds/alert.wav");<br> legA:execute("hangup");<br>end<br><br></div><div>and simple log of autoinform_cleanup.lua<br><br>dat = env:serialize() <br>freeswitch.consoleLog("INFO","Here's everything:\n" .. dat .. "\n")<br><br></div><div><br></div>It makes a call, but when autoinform_cleanup.lua is called<br></div>I see this in console<br><br>/usr/local/freeswitch/scripts/autoinform_cleanup.lua:1: attempt to index global 'env' (a nil value)<br><div><br><div><div><div><div><div><div><div><div><div><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Kamil Nigmatullin<br>Tel: 77272323748<br>mob: 7 (707) 2517003<br>Skype: kamil.nigmatullin</div></div>
</div></div></div></div></div></div></div></div></div></div></div>