diff --git a/resources/install/scripts/app/avmd/index.lua b/resources/install/scripts/app/avmd/index.lua new file mode 100644 index 0000000000..f9534c983d --- /dev/null +++ b/resources/install/scripts/app/avmd/index.lua @@ -0,0 +1,19 @@ +--subscribe to the events + events = freeswitch.EventConsumer("CUSTOM","avmd::beep"); + +--prepare the api object + api = freeswitch.API(); + +--get the events + for event in (function() return events:pop(1) end) do + --serialize the data for the console + --freeswitch.consoleLog("notice","event:" .. event:serialize("xml") .. "\n"); + --freeswitch.consoleLog("notice","event:" .. event:serialize("json") .. "\n"); + + --get the uuid + local uuid = event:getHeader("Unique-ID"); + freeswitch.consoleLog("[avmd] uuid: ", uuid .. "\n"); + + --end the call + reply = api:executeString("uuid_kill "..uuid.." NORMAL_CLEARING"); +end