From 3c603dbc5df39a821593d12523690a1d89437d5d Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Fri, 30 May 2014 06:34:57 +0000 Subject: [PATCH] Fix outbound caller id for outbound on net calls --- .../app/dialplan/resources/outbound/100_is_local.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/resources/install/scripts/app/dialplan/resources/outbound/100_is_local.lua b/resources/install/scripts/app/dialplan/resources/outbound/100_is_local.lua index 9284e08ee0..057a492e0e 100644 --- a/resources/install/scripts/app/dialplan/resources/outbound/100_is_local.lua +++ b/resources/install/scripts/app/dialplan/resources/outbound/100_is_local.lua @@ -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;