From d8967892fd113cab952639a03f1f5f234afd34ab Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Mon, 7 Jul 2014 20:15:13 +0000 Subject: [PATCH] Add AVMD lua script --- resources/install/scripts/app/avmd/index.lua | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 resources/install/scripts/app/avmd/index.lua 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