From a2e4fd00bd805ef628a6f2e676426b6a0d33eeae Mon Sep 17 00:00:00 2001 From: agree <37550360+greenbea@users.noreply.github.com> Date: Wed, 25 Aug 2021 12:28:26 -0400 Subject: [PATCH] [Extension] Don't null dial_string when enable/disable follow me or dnd (#6000) --- app/calls/call_edit.php | 1 - app/calls/resources/classes/call_forward.php | 3 --- app/calls/resources/classes/do_not_disturb.php | 5 ----- app/calls/resources/classes/follow_me.php | 2 -- .../xml_handler/resources/scripts/directory/directory.lua | 4 +++- 5 files changed, 3 insertions(+), 12 deletions(-) diff --git a/app/calls/call_edit.php b/app/calls/call_edit.php index fcdc03f560..72e462acb6 100644 --- a/app/calls/call_edit.php +++ b/app/calls/call_edit.php @@ -197,7 +197,6 @@ $array['extensions'][0]['domain_uuid'] = $_SESSION['domain_uuid']; $array['extensions'][0]['extension_uuid'] = $extension_uuid; $array['extensions'][0]['do_not_disturb'] = $dnd_enabled; - $array['extensions'][0]['dial_string'] = $dnd_enabled == "true" ? "error/user_busy" : ''; } //follow me config diff --git a/app/calls/resources/classes/call_forward.php b/app/calls/resources/classes/call_forward.php index e03f1d9daf..b69bfd7930 100644 --- a/app/calls/resources/classes/call_forward.php +++ b/app/calls/resources/classes/call_forward.php @@ -39,7 +39,6 @@ include "root.php"; private $number_alias; public $forward_all_destination; public $forward_all_enabled; - private $dial_string; private $toll_allow; public $accountcode; public $outbound_caller_id_name; @@ -68,11 +67,9 @@ include "root.php"; $array['extensions'][0]['extension_uuid'] = $this->extension_uuid; $array['extensions'][0]['forward_all_destination'] = strlen($this->forward_all_destination) != 0 ? $this->forward_all_destination : null; if (strlen($this->forward_all_destination) == 0 || $this->forward_all_enabled == "false") { - $array['extensions'][0]['dial_string'] = null; $array['extensions'][0]['forward_all_enabled'] = 'false'; } else { - $array['extensions'][0]['dial_string'] = $this->dial_string; $array['extensions'][0]['forward_all_enabled'] = 'true'; } diff --git a/app/calls/resources/classes/do_not_disturb.php b/app/calls/resources/classes/do_not_disturb.php index 8fd4e7c212..bcb1975df7 100644 --- a/app/calls/resources/classes/do_not_disturb.php +++ b/app/calls/resources/classes/do_not_disturb.php @@ -33,7 +33,6 @@ include "root.php"; public $extension_uuid; public $extension; public $enabled; - private $dial_string; //update the user_status public function user_status() { @@ -92,12 +91,8 @@ include "root.php"; } unset($sql, $parameters, $row); - //set the dial string - $this->dial_string = $this->enabled == "true" ? "error/user_busy" : ''; - //build extension update array $array['extensions'][0]['extension_uuid'] = $this->extension_uuid; - $array['extensions'][0]['dial_string'] = $this->dial_string; $array['extensions'][0]['do_not_disturb'] = $this->enabled; //grant temporary permissions diff --git a/app/calls/resources/classes/follow_me.php b/app/calls/resources/classes/follow_me.php index fa602d9654..eeac0e308b 100644 --- a/app/calls/resources/classes/follow_me.php +++ b/app/calls/resources/classes/follow_me.php @@ -242,12 +242,10 @@ include "root.php"; //add follow me to the array $array['follow_me'][0]["follow_me_uuid"] = $this->follow_me_uuid; $array['follow_me'][0]["domain_uuid"] = $this->domain_uuid; - $array['follow_me'][0]["dial_string"] = ''; //add extensions to the array $array['extensions'][0]["extension_uuid"] = $extension_uuid; $array['extensions'][0]["dial_domain"] = $this->domain_name; - $array['extensions'][0]["dial_string"] = ''; $array['extensions'][0]["follow_me_destinations"] = ''; $array['extensions'][0]["follow_me_enabled"] = $this->follow_me_enabled; diff --git a/app/scripts/resources/scripts/app/xml_handler/resources/scripts/directory/directory.lua b/app/scripts/resources/scripts/app/xml_handler/resources/scripts/directory/directory.lua index 1c46cec82d..7d2c155859 100644 --- a/app/scripts/resources/scripts/app/xml_handler/resources/scripts/directory/directory.lua +++ b/app/scripts/resources/scripts/app/xml_handler/resources/scripts/directory/directory.lua @@ -380,7 +380,9 @@ presence_id = (NUMBER_AS_PRESENCE_ID and sip_from_number or sip_from_user) .. "@" .. domain_name; --set the dial_string - if (string.len(row.dial_string) > 0) then + if (do_not_disturb == "true") then + dial_string = "error/USER_BUSY"; + elseif (string.len(row.dial_string) > 0) then dial_string = row.dial_string; else local destination = (DIAL_STRING_BASED_ON_USERID and sip_from_number or sip_from_user) .. "@" .. domain_name;