This is my ending of the lua script.
I'm very confused regarding who is the actor that hang up the call and how to detect side and most of all if this code can remain into my general LUA or if I have to use any hangup hook..any way, I'm pasting my code, hoping someone can help me.
originate_disposition = session:getVariable("originate_disposition");
originate_causes = session:getVariable("originate_causes");
-- is aleg hangup?
if (originate_causes ~= nil) then
last_balance = 10;
session:set_tts_params("flite", "kal");
session:speak("Credit remaining " .. last_balance .. " euros");
session:hangup();
end
-- when bleg?