diff options
author | spag <spag@golwen.net> | 2013-01-17 10:05:49 +0100 |
---|---|---|
committer | spag <spag@golwen.net> | 2013-01-17 10:05:49 +0100 |
commit | bc530494cca59845b5896ae4b0900ca1b9691827 (patch) | |
tree | 5a510ef1c2515fbf8617e5274ba4c37c9b246a5f /misc/freeswitch/scripts/dialplan | |
parent | 85d8dc12c3963f78ea1db4089c6ff2fa6ec205e9 (diff) |
set caller id numbers array
Diffstat (limited to 'misc/freeswitch/scripts/dialplan')
-rw-r--r-- | misc/freeswitch/scripts/dialplan/dialplan.lua | 18 |
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'); |