Merge pull request #5814 from daniel-lucio/patch-184

[4.5] DTMF handling
This commit is contained in:
FusionPBX 2021-03-17 17:43:31 -06:00 committed by GitHub
commit be990c2584
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 0 deletions

View 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"/>