mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-06 11:43:50 +00:00
Merge pull request #5814 from daniel-lucio/patch-184
[4.5] DTMF handling
This commit is contained in:
16
app/scripts/resources/scripts/dtmf_handler.lua
Normal file
16
app/scripts/resources/scripts/dtmf_handler.lua
Normal file
@@ -0,0 +1,16 @@
|
||||
--local s = event:serialize("xml")
|
||||
--local name = event:getHeader("Event-Name")
|
||||
--freeswitch.consoleLog("NOTICE", "Got event! " .. name)
|
||||
--freeswitch.consoleLog("NOTICE", "Serial!\n" .. s)
|
||||
|
||||
local call_uuid = event:getHeader("Caller-Unique-ID");
|
||||
--local channel_timestamp = event:getHeader("Event-Date-Timestamp");
|
||||
local channel_timestamp = os.time();
|
||||
local dtmf_value = event:getHeader("DTMF-Digit");
|
||||
|
||||
local session = freeswitch.Session(call_uuid);
|
||||
local history = channel_timestamp .. ':' .. dtmf_value .. "\n";
|
||||
session:execute("push", "dtmf_history="..history);
|
||||
|
||||
-- lua.conf.xml
|
||||
-- <hook event="DTMF" script="dtmf_handler.lua"/>
|
||||
Reference in New Issue
Block a user