From b4de6f5e4b94f5cca8b9a1a43925c3d2a3ad4470 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Fri, 28 Feb 2025 17:09:35 -0700 Subject: [PATCH] Use status voicemail Moved voicemail status after missed calls. This way, it will show the status of voicemail when it goes to voicemail. There is still a field in the CDR for missed_call and this will still be set to true. --- app/xml_cdr/resources/classes/xml_cdr.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/xml_cdr/resources/classes/xml_cdr.php b/app/xml_cdr/resources/classes/xml_cdr.php index 9cf18165ce..8d9f14e136 100644 --- a/app/xml_cdr/resources/classes/xml_cdr.php +++ b/app/xml_cdr/resources/classes/xml_cdr.php @@ -612,12 +612,6 @@ if (!class_exists('xml_cdr')) { if ($xml->variables->hangup_cause == 'NO_ANSWER') { $status = 'no_answer'; } - if (substr($destination_number, 0, 3) == '*99') { - $status = 'voicemail'; - } - if (isset($xml->variables->voicemail_message_seconds) && $xml->variables->voicemail_message_seconds > 0) { - $status = 'voicemail'; - } if ($xml->variables->hangup_cause == 'ORIGINATOR_CANCEL') { $status = 'cancelled'; } @@ -633,12 +627,18 @@ if (!class_exists('xml_cdr')) { if ($xml->variables->cc_side == 'agent' && $xml->variables->billsec == 0) { $status = 'no_answer'; } - if (!isset($status) && $xml->variables->billsec == 0) { + if (!isset($status) && $xml->variables->billsec == 0) { $status = 'no_answer'; } if ($missed_call == 'true') { $status = 'missed'; } + if (substr($destination_number, 0, 3) == '*99') { + $status = 'voicemail'; + } + if (!empty($xml->variables->voicemail_message_seconds)) { + $status = 'voicemail'; + } //set the key $key = 'xml_cdr';