From 8e79821304b99f36710922d53224c5707c4e73fb Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 6 Mar 2021 08:59:12 -0700 Subject: [PATCH] Remove forward_caller_id_uuid field. --- .../resources/scripts/call_forward.lua | 60 ++++--------------- 1 file changed, 10 insertions(+), 50 deletions(-) diff --git a/app/scripts/resources/scripts/call_forward.lua b/app/scripts/resources/scripts/call_forward.lua index bc97e5f130..33e69d8bd6 100644 --- a/app/scripts/resources/scripts/call_forward.lua +++ b/app/scripts/resources/scripts/call_forward.lua @@ -147,7 +147,6 @@ local last_forward_all_destination = row.forward_all_destination; local follow_me_uuid = row.follow_me_uuid; local toll_allow = row.toll_allow or ''; - local forward_caller_id_uuid = row.forward_caller_id_uuid; --toggle enabled if enabled == "toggle" then @@ -190,56 +189,17 @@ session:streamFile(sounds_dir.."/"..default_language.."/"..default_dialect.."/"..default_voice.."/ivr/ivr-call_forwarding_has_been_set.wav"); end ---get the caller_id for outbound call - local forward_caller_id = "" - if enabled == "true" and not empty(forward_caller_id_uuid) then - local sql = "select destination_number, destination_description,".. - "destination_caller_id_number, destination_caller_id_name " .. - "from v_destinations where domain_uuid = :domain_uuid and " .. - "destination_type = 'inbound' and destination_uuid = :destination_uuid"; - local params = {domain_uuid = domain_uuid; destination_uuid = forward_caller_id_uuid} - if (debug["sql"]) then - log.noticef("SQL: %s; params: %s", sql, json.encode(params)); - end - local row = dbh:first_row(sql, params) - if row then - local caller_id_number = row.destination_caller_id_number - if empty(caller_id_number) then - caller_id_number = row.destination_number - end - - local caller_id_name = row.destination_caller_id_name - if empty(caller_id_name) then - caller_id_name = row.destination_description - end - - if not empty(caller_id_number) then - forward_caller_id = forward_caller_id .. - ",outbound_caller_id_number=" .. caller_id_number .. - ",origination_caller_id_number=" .. caller_id_number - end - - if not empty(caller_id_name) then - forward_caller_id = forward_caller_id .. - ",outbound_caller_id_name=" .. caller_id_name .. - ",origination_caller_id_name=" .. caller_id_name - end - end - end - --get default caller_id for outbound call - if enabled == "true" and empty(forward_caller_id_uuid) then - if settings:get('cdr', 'call_forward_fix', 'boolean') == 'true' then - if not empty(row.outbound_caller_id_number) then - forward_caller_id = forward_caller_id .. - ",outbound_caller_id_number=" .. row.outbound_caller_id_number .. - ",origination_caller_id_number=" .. row.outbound_caller_id_number - end - if not empty(row.outbound_caller_id_name) then - forward_caller_id = forward_caller_id .. - ",outbound_caller_id_name=" .. row.outbound_caller_id_name .. - ",origination_caller_id_name=" .. row.outbound_caller_id_name - end + if enabled == "true" and settings:get('cdr', 'call_forward_fix', 'boolean') == 'true' then + if not empty(row.outbound_caller_id_number) then + forward_caller_id = forward_caller_id .. + ",outbound_caller_id_number=" .. row.outbound_caller_id_number .. + ",origination_caller_id_number=" .. row.outbound_caller_id_number + end + if not empty(row.outbound_caller_id_name) then + forward_caller_id = forward_caller_id .. + ",outbound_caller_id_name=" .. row.outbound_caller_id_name .. + ",origination_caller_id_name=" .. row.outbound_caller_id_name end end