Fix call block save call detail record condition (#7455)

This commit is contained in:
frytimo
2025-08-15 18:13:13 -03:00
committed by GitHub
parent 506093fd64
commit 20319af117

View File

@@ -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