Update index.lua
This commit is contained in:
parent
6c60fc6265
commit
5a142bef69
|
|
@ -54,6 +54,9 @@
|
||||||
--send info to the log
|
--send info to the log
|
||||||
--freeswitch.consoleLog("notice","[ring_groups] originate_disposition: " .. session:getVariable("originate_disposition") .. "\n");
|
--freeswitch.consoleLog("notice","[ring_groups] originate_disposition: " .. session:getVariable("originate_disposition") .. "\n");
|
||||||
|
|
||||||
|
--status
|
||||||
|
status = 'answered'
|
||||||
|
|
||||||
--run the missed called function
|
--run the missed called function
|
||||||
if (
|
if (
|
||||||
session:getVariable("originate_disposition") == "ALLOTTED_TIMEOUT"
|
session:getVariable("originate_disposition") == "ALLOTTED_TIMEOUT"
|
||||||
|
|
@ -67,10 +70,26 @@
|
||||||
or session:getVariable("originate_disposition") == "failure"
|
or session:getVariable("originate_disposition") == "failure"
|
||||||
or session:getVariable("originate_disposition") == "ORIGINATOR_CANCEL"
|
or session:getVariable("originate_disposition") == "ORIGINATOR_CANCEL"
|
||||||
) then
|
) then
|
||||||
|
--set the status
|
||||||
|
status = 'missed'
|
||||||
--send missed call notification
|
--send missed call notification
|
||||||
missed();
|
missed();
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--send the ring group event
|
||||||
|
event = freeswitch.Event("CUSTOM", "RING_GROUPS");
|
||||||
|
event:addHeader("domain_uuid", domain_uuid);
|
||||||
|
event:addHeader("domain_name", domain_name);
|
||||||
|
event:addHeader("ring_group_uuid", ring_group_uuid);
|
||||||
|
event:addHeader("user_uuid", user_uuid);
|
||||||
|
event:addHeader("ring_group_name", ring_group_name);
|
||||||
|
event:addHeader("ring_group_extension", ring_group_extension);
|
||||||
|
event:addHeader("status", status);
|
||||||
|
event:addHeader("call_uuid", uuid);
|
||||||
|
event:addHeader("caller_id_name", caller_id_name);
|
||||||
|
event:addHeader("caller_id_number", caller_id_number);
|
||||||
|
event:fire();
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--set the hangup hook function
|
--set the hangup hook function
|
||||||
|
|
@ -180,19 +199,6 @@
|
||||||
--check the missed calls
|
--check the missed calls
|
||||||
function missed()
|
function missed()
|
||||||
|
|
||||||
--send a missed call event
|
|
||||||
local event = freeswitch.Event("CUSTOM", "MISSED_CALLS");
|
|
||||||
event:addHeader("domain_uuid", domain_uuid);
|
|
||||||
event:addHeader("domain_name", domain_name);
|
|
||||||
event:addHeader("ring_group_uuid", ring_group_uuid);
|
|
||||||
event:addHeader("user_uuid", user_uuid);
|
|
||||||
event:addHeader("ring_group_name", ring_group_name);
|
|
||||||
event:addHeader("ring_group_extension", ring_group_extension);
|
|
||||||
event:addHeader("call_uuid", uuid);
|
|
||||||
event:addHeader("caller_id_name", caller_id_name);
|
|
||||||
event:addHeader("caller_id_number", caller_id_number);
|
|
||||||
event:fire();
|
|
||||||
|
|
||||||
--send missed call email
|
--send missed call email
|
||||||
if (missed_call_app ~= nil and missed_call_data ~= nil) then
|
if (missed_call_app ~= nil and missed_call_data ~= nil) then
|
||||||
if (missed_call_app == "email") then
|
if (missed_call_app == "email") then
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue