summaryrefslogtreecommitdiff
path: root/misc/freeswitch
diff options
context:
space:
mode:
Diffstat (limited to 'misc/freeswitch')
-rw-r--r--misc/freeswitch/scripts/dialplan/dialplan.lua18
1 files changed, 15 insertions, 3 deletions
diff --git a/misc/freeswitch/scripts/dialplan/dialplan.lua b/misc/freeswitch/scripts/dialplan/dialplan.lua
index 32f59c2..704728a 100644
--- a/misc/freeswitch/scripts/dialplan/dialplan.lua
+++ b/misc/freeswitch/scripts/dialplan/dialplan.lua
@@ -757,6 +757,21 @@ function Dialplan.switch(self, destination)
elseif not common.str.blank(destination.number) then
local result = { continue = false, code = 404, phrase = 'No route' }
+ local clip_no_screening = common.str.try(caller, 'account.record.clip_no_screening');
+ self.caller.caller_id_numbers = {}
+ if not common.str.blank(clip_no_screening) then
+ for index, number in ipairs(common.str.strip_to_a(clip_no_screening, ',')) do
+ table.insert(self.caller.caller_id_numbers, number);
+ end
+ end
+ for index, number in ipairs(self.caller.caller_phone_numbers) do
+ table.insert(self.caller.caller_id_numbers, number);
+ end
+ self.log:info('CALLER_ID_NUMBERS - clir: ', self.caller.clir, ', numbers: ', table.concat(self.caller.caller_id_numbers, ','));
+
+ destination.callee_id_number = destination.number;
+ destination.callee_id_name = nil;
+
require 'dialplan.router'
local routes = dialplan.router.Router:new{ log = self.log, database = self.database, caller = self.caller }:route_run('outbound', destination.number);
@@ -765,9 +780,6 @@ function Dialplan.switch(self, destination)
return { continue = false, code = 404, phrase = 'No route' }
end
- destination.callee_id_number = destination.number;
- destination.callee_id_name = nil;
-
if self.phonebook_number_lookup then
require 'common.str'
local user_id = common.str.try(self.caller, 'account.owner.id');