From ba2f5c379f431f45254f29a6e333575728ef1d2c Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Tue, 18 Jan 2022 12:05:32 -0700 Subject: [PATCH] Only compare sip_from_domain with domain_name if the sip_from_domain exists. --- app/xml_cdr/resources/classes/xml_cdr.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/xml_cdr/resources/classes/xml_cdr.php b/app/xml_cdr/resources/classes/xml_cdr.php index d8df0219ae..4bd39a91dc 100644 --- a/app/xml_cdr/resources/classes/xml_cdr.php +++ b/app/xml_cdr/resources/classes/xml_cdr.php @@ -313,11 +313,13 @@ if (!class_exists('xml_cdr')) { //if the sip_from_domain and domain_name are not the same then original call direction was inbound //when an inbound call is forward the call_direction is set to inbound and then updated to outbound //use sip_from_display and sip_from_user to get the original caller ID instead of the updated caller ID info from the forward - if (urldecode($xml->variables->sip_from_domain) != urldecode($xml->variables->domain_name) && isset($xml->variables->sip_from_display)) { - $caller_id_name = urldecode($xml->variables->sip_from_display); - } - if (urldecode($xml->variables->sip_from_domain) != urldecode($xml->variables->domain_name) && isset($xml->variables->sip_from_user)) { - $caller_id_number = urldecode($xml->variables->sip_from_user); + if (isset($xml->variables->sip_from_domain) && urldecode($xml->variables->sip_from_domain) != urldecode($xml->variables->domain_name)) { + if (isset($xml->variables->sip_from_display)) { + $caller_id_name = urldecode($xml->variables->sip_from_display); + } + if (isset($xml->variables->sip_from_user)) { + $caller_id_number = urldecode($xml->variables->sip_from_user); + } } //get the values from the callflow.