From 20319af117a0a9a58e095d88c8fadcede1fb43db Mon Sep 17 00:00:00 2001 From: frytimo Date: Fri, 15 Aug 2025 18:13:13 -0300 Subject: [PATCH] Fix call block save call detail record condition (#7455) --- app/xml_cdr/resources/classes/xml_cdr.php | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/app/xml_cdr/resources/classes/xml_cdr.php b/app/xml_cdr/resources/classes/xml_cdr.php index 5526f2caa0..3cab5527fe 100644 --- a/app/xml_cdr/resources/classes/xml_cdr.php +++ b/app/xml_cdr/resources/classes/xml_cdr.php @@ -375,19 +375,20 @@ } //skip call detail records for calls blocked by call block - if (isset($xml->variables->call_block) && !empty($this->settings->get('call_block', 'save_call_detail_record'))) { - if ($xml->variables->call_block == 'true' && $this->settings->get('call_block', 'save_call_detail_record', false) !== true) { - //delete the xml cdr file - if (!empty($this->settings->get('switch', 'log'))) { - $xml_cdr_dir = $this->settings->get('switch', 'log').'/xml_cdr'; - if (file_exists($xml_cdr_dir.'/'.$this->file)) { - unlink($xml_cdr_dir.'/'.$this->file); - } + if (isset($xml->variables->call_block) + && $xml->variables->call_block == 'true' + && !$this->settings->get('call_block', 'save_call_detail_record', true) + ) { + //delete the xml cdr file + if (!empty($this->settings->get('switch', 'log'))) { + $xml_cdr_dir = $this->settings->get('switch', 'log').'/xml_cdr'; + if (file_exists($xml_cdr_dir.'/'.$this->file)) { + unlink($xml_cdr_dir.'/'.$this->file); } - - //return without saving - return false; } + + //return without saving + return false; } //check for duplicate call uuid's