diff --git a/app/xml_cdr/v_xml_cdr_import.php b/app/xml_cdr/v_xml_cdr_import.php index 25f8097f98..5e3cc821ab 100644 --- a/app/xml_cdr/v_xml_cdr_import.php +++ b/app/xml_cdr/v_xml_cdr_import.php @@ -209,7 +209,11 @@ //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); + if ($xml->variables->call_direction == 'inbound' ){ + $database->fields['caller_id_number'] = urldecode($xml->variables->caller_id_number); + } else { + $database->fields['caller_id_number'] = urldecode($xml->variables->effective_caller_id_number); + } //get the values from the callflow. $i = 0;