Get caller ID from the same call flow -> caller profile

This is the same place we get caller ID from in the XML CDR Details page.
This commit is contained in:
FusionPBX 2022-08-23 13:13:34 -06:00 committed by GitHub
parent d52695b29f
commit 2cd382ec38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 3 deletions

View File

@ -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)) {