From 2d872a35668ed17e397f689f675627d589d5fffa Mon Sep 17 00:00:00 2001 From: jacobbuscher-bt <111894981+jacobbuscher-bt@users.noreply.github.com> Date: Wed, 2 Aug 2023 12:25:45 -0600 Subject: [PATCH] Finalize changing origination_callee_id_name from destination_number to caller_destination in domain_variables and variables dialplan. (#6782) * Add the / character to the ALLOWED_CHARS variable to fix bug with front slashes being stripped. Previously was turning /var/lib/freeswitch into varlibfreeswitch * Update app_defaults.php Updating app defaults for Dialplan -> Domain Variables to set origination_callee_id_name to match the caller_destination instead of the destination number so that if you call another tenant in the same Fusion instance without is_local enabled the caller_destination shows instead of the tenant's called extension. * Update app_defaults.php Instead of removing the export all together we need to update it from destination_number to caller_destination. * Update 020_domain-variables.xml Set origination callee ID to caller_destination so internal calls don't show "Outbound Call" --------- Authored-by: Jacob Buscher --- app/dialplans/app_defaults.php | 20 +++++++++---------- .../conf/dialplan/020_domain-variables.xml | 1 + 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/app/dialplans/app_defaults.php b/app/dialplans/app_defaults.php index f2e95b86d1..c2b0f0d09d 100644 --- a/app/dialplans/app_defaults.php +++ b/app/dialplans/app_defaults.php @@ -132,18 +132,18 @@ $database = new database; $num_rows = $database->select($sql, null, 'column'); if ($num_rows > 0) { - $sql = "delete from v_dialplan_details \n"; - $sql .= "where dialplan_uuid in (select dialplan_uuid from v_dialplans where dialplan_name = 'domain-variables' or dialplan_name = 'variables') \n"; - $sql .= "and dialplan_detail_data like 'origination_callee_id_name%'; \n"; - $database->execute($sql); + $sql = "update v_dialplan_details set dialplan_detail_data = 'origination_callee_id_name=\${caller_destination}', update_date = now() \n"; + $sql .= "where dialplan_uuid in (select dialplan_uuid from v_dialplans where dialplan_name = 'domain-variables' or dialplan_name = 'variables') \n"; + $sql .= "and dialplan_detail_data = 'origination_callee_id_name=\${destination_number}'; \n"; + $database->execute($sql); - $sql = "update v_dialplans set dialplan_xml = REPLACE(dialplan_xml, '', ''), update_date = now() \n"; - $sql .= "where dialplan_uuid in (select dialplan_uuid from v_dialplans where dialplan_name = 'domain-variables' or dialplan_name = 'variables'); \n"; - $database->execute($sql); + $sql = "update v_dialplans set dialplan_xml = REPLACE(dialplan_xml, '', ''), update_date = now() \n"; + $sql .= "where dialplan_uuid in (select dialplan_uuid from v_dialplans where dialplan_name = 'domain-variables' or dialplan_name = 'variables'); \n"; + $database->execute($sql); - $sql = "update v_dialplans set dialplan_xml = REPLACE(dialplan_xml, '', ''), update_date = now() \n"; - $sql .= "where dialplan_uuid in (select dialplan_uuid from v_dialplans where dialplan_name = 'domain-variables' or dialplan_name = 'variables'); \n"; - $database->execute($sql); + $sql = "update v_dialplans set dialplan_xml = REPLACE(dialplan_xml, '', ''), update_date = now() \n"; + $sql .= "where dialplan_uuid in (select dialplan_uuid from v_dialplans where dialplan_name = 'domain-variables' or dialplan_name = 'variables'); \n"; + $database->execute($sql); } unset($sql, $num_rows); } diff --git a/app/dialplans/resources/switch/conf/dialplan/020_domain-variables.xml b/app/dialplans/resources/switch/conf/dialplan/020_domain-variables.xml index 34dcd96d94..24c1cb27fe 100644 --- a/app/dialplans/resources/switch/conf/dialplan/020_domain-variables.xml +++ b/app/dialplans/resources/switch/conf/dialplan/020_domain-variables.xml @@ -1,5 +1,6 @@ +