From b61f9375ffccf1c5ecec50f6c63dcf10fe5744a4 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Wed, 15 May 2024 14:41:44 -0600 Subject: [PATCH] Update the caller ID when using intercept When intercept is used then use the last_sent_callee_id_name and last_sent_callee_id_number for the caller ID information. --- app/xml_cdr/resources/classes/xml_cdr.php | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/app/xml_cdr/resources/classes/xml_cdr.php b/app/xml_cdr/resources/classes/xml_cdr.php index 54f8fc51cb..28e1b31edf 100644 --- a/app/xml_cdr/resources/classes/xml_cdr.php +++ b/app/xml_cdr/resources/classes/xml_cdr.php @@ -413,19 +413,18 @@ if (!class_exists('xml_cdr')) { if (isset($xml->variables->effective_caller_id_name)) { $caller_id_name = urldecode($xml->variables->effective_caller_id_name); } - - if (isset($xml->variables->origination_caller_id_name)) { - $caller_id_name = urldecode($xml->variables->origination_caller_id_name); - } - - if (isset($xml->variables->origination_caller_id_number)) { - $caller_id_number = urldecode($xml->variables->origination_caller_id_number); - } - if (urldecode($call_direction) == 'outbound' && isset($xml->variables->effective_caller_id_number)) { $caller_id_number = urldecode($xml->variables->effective_caller_id_number); } + //if intercept is used then update use the last sent callee id name and number + if (isset(($xml->variables->last_app) && $xml->variables->last_app == 'intercept' && !empty($xml->variables->last_sent_callee_id_name)) { + $caller_id_name = urldecode($xml->variables->last_sent_callee_id_name); + } + if (isset(($xml->variables->last_app) && $xml->variables->last_app == 'intercept' && !empty($xml->variables->last_sent_callee_id_number)) { + $caller_id_number = urldecode($xml->variables->last_sent_callee_id_number); + } + //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