From 5e04c6382459af842fb4c46c536f5611a74431e6 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 29 Jul 2023 12:55:52 -0600 Subject: [PATCH] remove origination_callee_id_name from domain-variables dialplan Removed for these reasons. - Update the caller's display when making a call to the final destination number rather than the number that was called. - It also modifies the phone history of called numbers - Changes the number in Call Detail Records to the final destination rather than Caller's Destination --- app/dialplans/app_defaults.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/app/dialplans/app_defaults.php b/app/dialplans/app_defaults.php index 194b8723a3..aad525283b 100644 --- a/app/dialplans/app_defaults.php +++ b/app/dialplans/app_defaults.php @@ -124,6 +124,30 @@ } +//remove origination_callee_id_name from domain-variables dialplan + if ($domains_processed == 1) { + $sql = "select count(*) from v_dialplans "; + $sql .= "where dialplan_name = 'domain-variables' "; + $sql .= "and dialplan_xml like '%origination_callee_id_name%' "; + $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_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); + } + //add not found dialplan to inbound routes /* if ($domains_processed == 1) {