From bbabb4f8618e8e55963e59c002c6ab5a89592158 Mon Sep 17 00:00:00 2001 From: Andy-Seattle <56096200+Andy-Seattle@users.noreply.github.com> Date: Fri, 5 Apr 2024 16:36:25 -0700 Subject: [PATCH] Handle ERR no such channel during call intercepts (#6943) When call center is not enabled, during a standard call intercept sometimes we are seeing an error as follows: call_center_queue_uuid=-ERR%20No%20such%20channel!%0A cc_queue_joined_epoch=-ERR%20No%20such%20channel!%0A Normally it returns call_center_queue_uuid=_undef_ but occasionally shows the ERR message. When the epoch variable is set to this it causes the XML CDR service to continually stop and start at the same CDR which raises the CPU load on the server significantly until the CDR is deleted. This code fix will handle the ERR message in the same way as _undef_. --- app/xml_cdr/resources/classes/xml_cdr.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/xml_cdr/resources/classes/xml_cdr.php b/app/xml_cdr/resources/classes/xml_cdr.php index bdd7e78099..1bdd590fae 100644 --- a/app/xml_cdr/resources/classes/xml_cdr.php +++ b/app/xml_cdr/resources/classes/xml_cdr.php @@ -645,8 +645,8 @@ if (!class_exists('xml_cdr')) { if ($xml->variables->cc_member_uuid == '_undef_') { $xml->variables->cc_member_uuid = ''; } if ($xml->variables->cc_member_session_uuid == '_undef_') { $xml->variables->cc_member_session_uuid = ''; } if ($xml->variables->cc_agent_uuid == '_undef_') { $xml->variables->cc_agent_uuid = ''; } - if ($xml->variables->call_center_queue_uuid == '_undef_') { $xml->variables->call_center_queue_uuid = ''; } - if ($xml->variables->cc_queue_joined_epoch == '_undef_') { $xml->variables->cc_queue_joined_epoch = ''; } + if ( ($xml->variables->call_center_queue_uuid == '_undef_') || ( (!is_uuid($xml->variables->call_center_queue_uuid) ) ) ) { $xml->variables->call_center_queue_uuid = ''; } + if ( ($xml->variables->cc_queue_joined_epoch == '_undef_') || ( (!is_numeric($xml->variables->cc_queue_joined_epoch) ) ) ) { $xml->variables->cc_queue_joined_epoch = ''; } $this->array[$key][0]['cc_side'] = urldecode($xml->variables->cc_side); $this->array[$key][0]['cc_member_uuid'] = urldecode($xml->variables->cc_member_uuid); $this->array[$key][0]['cc_queue'] = urldecode($xml->variables->cc_queue);