mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-02-01 05:29:18 +00:00
Add AVMD lua script
This commit is contained in:
19
resources/install/scripts/app/avmd/index.lua
Normal file
19
resources/install/scripts/app/avmd/index.lua
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user