This commit is contained in:
markjcrane
2015-10-07 10:45:51 -07:00
@@ -626,32 +626,23 @@ local log = require "resources.functions.log".ring_group
app_data = app_data:gsub("%]", "}"); app_data = app_data:gsub("%]", "}");
end end
freeswitch.consoleLog("NOTICE", "[ring group] app_data: "..app_data.."\n"); freeswitch.consoleLog("NOTICE", "[ring group] app_data: "..app_data.."\n");
-- log.noticef("bridge begin: originate_disposition:%s answered:%s ready:%s bridged:%s", session:getVariable("originate_disposition"), session:answered() and "true" or "false", session:ready() and "true" or "false", session:bridged() and "true" or "false")
session:execute("bridge", app_data); session:execute("bridge", app_data);
-- log.noticef("bridge done: originate_disposition:%s answered:%s ready:%s bridged:%s", session:getVariable("originate_disposition"), session:answered() and "true" or "false", session:ready() and "true" or "false", session:bridged() and "true" or "false") -- log.noticef("bridge done: originate_disposition:%s answered:%s ready:%s bridged:%s", session:getVariable("originate_disposition"), session:answered() and "true" or "false", session:ready() and "true" or "false", session:bridged() and "true" or "false")
end end
--timeout destination --timeout destination
if (app_data ~= nil) then if (app_data ~= nil) then
if ring_group_strategy == "enterprise" if session:ready() and (
and ( true session:getVariable("originate_disposition") == "ALLOTTED_TIMEOUT"
--- I see 2 errors here `failure` and `PICKED_OFF`
--- but they be more. I think check `answered` is enough.
-- or session:getVariable("originate_disposition") == "failure"
-- or session:getVariable("originate_disposition") == "PICKED_OFF"
)
and session:answered() then
-- for enterprise calls when intercept we get "failure" but session answered
return
end
if (session:getVariable("originate_disposition") == "ALLOTTED_TIMEOUT"
or session:getVariable("originate_disposition") == "NO_ANSWER" or session:getVariable("originate_disposition") == "NO_ANSWER"
or session:getVariable("originate_disposition") == "NO_USER_RESPONSE" or session:getVariable("originate_disposition") == "NO_USER_RESPONSE"
or session:getVariable("originate_disposition") == "USER_NOT_REGISTERED" or session:getVariable("originate_disposition") == "USER_NOT_REGISTERED"
or session:getVariable("originate_disposition") == "NORMAL_TEMPORARY_FAILURE" or session:getVariable("originate_disposition") == "NORMAL_TEMPORARY_FAILURE"
or session:getVariable("originate_disposition") == "NO_ROUTE_DESTINATION" or session:getVariable("originate_disposition") == "NO_ROUTE_DESTINATION"
or session:getVariable("originate_disposition") == "USER_BUSY" or session:getVariable("originate_disposition") == "USER_BUSY"
or session:getVariable("originate_disposition") == "failure") then or session:getVariable("originate_disposition") == "failure"
) then
--send missed call notification --send missed call notification
missed(); missed();
--execute the time out action --execute the time out action