This commit is contained in:
markjcrane
2015-09-26 09:00:11 -06:00
10 changed files with 85 additions and 27 deletions
@@ -27,6 +27,8 @@
-- Mark J Crane <markjcrane@fusionpbx.com>
-- Luis Daniel Lucio Qurioz <dlucio@okay.com.mx>
local log = require "resources.functions.log".ring_group
--connect to the database
require "resources.functions.database_handle";
dbh = database_handle('system');
@@ -618,10 +620,23 @@
end
freeswitch.consoleLog("NOTICE", "[ring group] app_data: "..app_data.."\n");
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")
end
--timeout destination
if (app_data ~= nil) then
if ring_group_strategy == "enterprise"
and ( true
--- 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_USER_RESPONSE"
@@ -32,9 +32,9 @@
sql = [[SELECT extension, number_alias from v_extensions
WHERE domain_uuid = ']] .. domain_uuid ..[['
AND (mwi_account = ']]..voicemail_id..[[' or mwi_account = ']]..voicemail_id..[[@]]..domain_name..[[')]];
--if (debug["sql"]) then
if (debug["sql"]) then
freeswitch.consoleLog("notice", "[voicemail] SQL: " .. sql .. "\n");
--end
end
status = dbh:query(sql, function(row)
if (string.len(row["number_alias"]) > 0) then
table.insert(accounts, row["number_alias"]);
@@ -74,4 +74,4 @@
event:addHeader("MWI-Voice-Message", message_count.."/0 ("..message_count.."/0)");
event:fire();
end
end
end