Update index.lua

This commit is contained in:
FusionPBX
2019-04-10 09:46:30 -06:00
committed by GitHub
parent c3cbaeea86
commit 0fac90e387

View File

@@ -51,16 +51,6 @@
value, err = cache.get(key);
if (err == 'NOT FOUND') then
--set the outbound caller id
if (outbound_caller_id_name ~= nil) then
session:execute("set", "caller_id_name="..outbound_caller_id_name);
session:execute("set", "effective_caller_id_name="..outbound_caller_id_name);
end
if (outbound_caller_id_number ~= nil) then
session:execute("set", "caller_id_number="..outbound_caller_id_number);
session:execute("set", "effective_caller_id_number="..outbound_caller_id_number);
end
--connect to the database
local Database = require "resources.functions.database";
local dbh = Database.new('system');
@@ -94,6 +84,16 @@
--log the result
freeswitch.consoleLog("notice", "[app:dialplan:outbound:is_local] " .. row.destination_number .. " XML " .. destination_context .. " source: database\n");
--set the outbound caller id
if (outbound_caller_id_name ~= nil) then
session:execute("set", "caller_id_name="..outbound_caller_id_name);
session:execute("set", "effective_caller_id_name="..outbound_caller_id_name);
end
if (outbound_caller_id_number ~= nil) then
session:execute("set", "caller_id_number="..outbound_caller_id_number);
session:execute("set", "effective_caller_id_number="..outbound_caller_id_number);
end
--transfer the call
session:transfer(row.destination_number, "XML", row.destination_context);
end);
@@ -116,6 +116,16 @@
var[key] = value;
end
--set the outbound caller id
if (outbound_caller_id_name ~= nil) then
session:execute("set", "caller_id_name="..outbound_caller_id_name);
session:execute("set", "effective_caller_id_name="..outbound_caller_id_name);
end
if (outbound_caller_id_number ~= nil) then
session:execute("set", "caller_id_number="..outbound_caller_id_number);
session:execute("set", "effective_caller_id_number="..outbound_caller_id_number);
end
--send to the console
freeswitch.consoleLog("notice", "[app:dialplan:outbound:is_local] " .. value .. " source: cache\n");