diff --git a/app/xml_cdr/resources/classes/xml_cdr.php b/app/xml_cdr/resources/classes/xml_cdr.php index e181dbd616..26a750e12c 100644 --- a/app/xml_cdr/resources/classes/xml_cdr.php +++ b/app/xml_cdr/resources/classes/xml_cdr.php @@ -298,11 +298,22 @@ if (!class_exists('xml_cdr')) { //process data if the call detail record is not a duplicate if ($duplicate_uuid == false && is_uuid($uuid)) { - //get the caller ID - if (isset($xml->variables->caller_id_name)) { + //get the caller ID from call flow caller profile + $i = 0; + foreach ($xml->callflow as $row) { + if ($i == 0) { + $caller_id_name = urldecode($row->caller_profile->caller_id_name); + $caller_id_number = urldecode($row->caller_profile->caller_id_number); + } + $i++; + } + unset($i); + + //get the caller ID from variables + if (!isset($caller_id_number) && isset($xml->variables->caller_id_name)) { $caller_id_name = urldecode($xml->variables->caller_id_name); } - if (isset($xml->variables->caller_id_number)) { + if (!isset($caller_id_number) && isset($xml->variables->caller_id_number)) { $caller_id_number = urldecode($xml->variables->caller_id_number); } if (!isset($caller_id_number) && isset($xml->variables->sip_from_user)) {