From 92e9c7e5ebb9e7e2d3e5ccec23357fd7f209f570 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Wed, 17 Oct 2018 15:41:14 -0600 Subject: [PATCH] Update v_xml_cdr_import.php --- app/xml_cdr/v_xml_cdr_import.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/app/xml_cdr/v_xml_cdr_import.php b/app/xml_cdr/v_xml_cdr_import.php index 08dd25f8cd..2b7529a7e3 100644 --- a/app/xml_cdr/v_xml_cdr_import.php +++ b/app/xml_cdr/v_xml_cdr_import.php @@ -191,6 +191,10 @@ $database->fields['rtp_audio_in_mos'] = $rtp_audio_in_mos; } + //get the caller details + $database->fields['caller_id_name'] = urldecode($xml->variables->effective_caller_id_name); + $database->fields['caller_id_number'] = urldecode($xml->variables->effective_caller_id_number); + //get the values from the callflow. $x = 0; foreach ($xml->callflow as $row) { @@ -200,8 +204,12 @@ $database->fields['context'] = $context; $database->fields['network_addr'] = check_str(urldecode($row->caller_profile->network_addr)); } - $database->fields['caller_id_name'] = check_str(urldecode($row->caller_profile->caller_id_name)); - $database->fields['caller_id_number'] = check_str(urldecode($row->caller_profile->caller_id_number)); + if (strlen($caller_id_name) == 0) { + $database->fields['caller_id_name'] = check_str(urldecode($row->caller_profile->caller_id_name)); + } + if (strlen($caller_id_number) == 0) { + $database->fields['caller_id_number'] = check_str(urldecode($row->caller_profile->caller_id_number)); + } $x++; } unset($x);