Fix outbound caller id for outbound on net calls

This commit is contained in:
Mark Crane
2014-05-30 06:34:57 +00:00
parent 5c41168343
commit 40adf2c11c

View File

@@ -42,6 +42,18 @@
sql = sql .. "AND destination_enabled = 'true' "
--freeswitch.consoleLog("notice", "SQL:" .. sql .. "\n");
assert(dbh:query(sql, function(row)
--get the outbound caller id
outbound_caller_id_name = session:getVariable("outbound_caller_id_name");
outbound_caller_id_number = session:getVariable("outbound_caller_id_number");
--set the outbound caller id
if (outbound_caller_id_name ~= nil) then
session:execute("set", "effective_caller_id_name="..outbound_caller_id_name);
end
if (outbound_caller_id_number ~= nil) then
session:execute("set", "effective_caller_id_number="..outbound_caller_id_number);
end
--set the local variables
destination_context = row.destination_context;