From 76a4e9dd50215b26152899bafa88a1eb4cdd677f Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Tue, 15 Mar 2022 14:33:44 -0600 Subject: [PATCH] Work on caller_destination, caller_id_name and caller_id_number. --- app/xml_cdr/resources/classes/xml_cdr.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/app/xml_cdr/resources/classes/xml_cdr.php b/app/xml_cdr/resources/classes/xml_cdr.php index aa6b2341d7..c48e32383a 100644 --- a/app/xml_cdr/resources/classes/xml_cdr.php +++ b/app/xml_cdr/resources/classes/xml_cdr.php @@ -302,6 +302,14 @@ if (!class_exists('xml_cdr')) { $caller_id_name = urldecode($xml->variables->caller_id_name); $caller_id_number = urldecode($xml->variables->caller_id_number); + //if the origination caller id name and number are set then use them + 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 the call is outbound use the external caller ID if (isset($xml->variables->effective_caller_id_name)) { $caller_id_name = urldecode($xml->variables->effective_caller_id_name); @@ -347,6 +355,14 @@ if (!class_exists('xml_cdr')) { } } + //get the caller_destination + if (isset($xml->variables->caller_destination) ) { + $caller_destination = urldecode($xml->variables->caller_destination); + } + if (isset($xml->variables->sip_h_caller_destination) ) { + $caller_destination = urldecode($xml->variables->sip_h_caller_destination); + } + //set missed calls if (isset($xml->variables->answer_stamp) && isset($xml->variables->bridge_uuid)) { //answered call @@ -368,7 +384,7 @@ if (!class_exists('xml_cdr')) { $this->array[$key]['missed_call'] = $missed_call; $this->array[$key]['caller_id_name'] = $caller_id_name; $this->array[$key]['caller_id_number'] = $caller_id_number; - $this->array[$key]['caller_destination'] = urldecode($xml->variables->caller_destination); + $this->array[$key]['caller_destination'] = $caller_destination; $this->array[$key]['accountcode'] = urldecode($xml->variables->accountcode); $this->array[$key]['default_language'] = urldecode($xml->variables->default_language); $this->array[$key]['bridge_uuid'] = urldecode($xml->variables->bridge_uuid);