Update xml_cdr.php

This commit is contained in:
FusionPBX 2020-05-05 21:32:33 -06:00 committed by GitHub
parent 30be1a99a8
commit 314a217d56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 25 additions and 30 deletions

View File

@ -284,19 +284,33 @@ if (!class_exists('xml_cdr')) {
//process data if the call detail record is not a duplicate //process data if the call detail record is not a duplicate
if ($duplicate_uuid == false && is_uuid($uuid)) { if ($duplicate_uuid == false && is_uuid($uuid)) {
//get the destination number //get the caller details
if ($xml->variables->current_application == "bridge") { $caller_id_name = urldecode($xml->variables->caller_id_name);
$current_application_data = urldecode($xml->variables->current_application_data); $caller_id_number = urldecode($xml->variables->caller_id_number);
$bridge_array = explode("/", $current_application_data); if (isset($xml->variables->effective_caller_id_name)) {
$destination_number = end($bridge_array); $caller_id_name = urldecode($xml->variables->effective_caller_id_name);
if (strpos($destination_number,'@') !== FALSE) { }
$destination_array = explode("@", $destination_number); if (isset($xml->variables->effective_caller_id_number)) {
$destination_number = $destination_array[0]; $caller_id_number = urldecode($xml->variables->effective_caller_id_number);
}
//get the values from the callflow.
$i = 0;
foreach ($xml->callflow as $row) {
if ($i == 0) {
$context = urldecode($row->caller_profile->context);
$destination_number = urldecode($row->caller_profile->destination_number);
$network_addr = urldecode($row->caller_profile->network_addr);
} }
if (strlen($caller_id_name) == 0) {
$caller_id_name = urldecode($row->caller_profile->caller_id_name);
}
if (strlen($caller_id_number) == 0) {
$caller_id_number = urldecode($row->caller_profile->caller_id_number);
}
$i++;
} }
else { unset($i);
$destination_number = urldecode($xml->variables->sip_to_user);
}
//if last_sent_callee_id_number is set use it for the destination_number //if last_sent_callee_id_number is set use it for the destination_number
if (strlen($xml->variables->last_sent_callee_id_number) > 0) { if (strlen($xml->variables->last_sent_callee_id_number) > 0) {
@ -322,25 +336,6 @@ if (!class_exists('xml_cdr')) {
$missed_call = 'true'; $missed_call = 'true';
} }
//get the caller details
$caller_id_name = urldecode($xml->variables->caller_id_name);
$caller_id_number = urldecode($xml->variables->caller_id_number);
if (isset($xml->variables->effective_caller_id_name)) {
$caller_id_name = urldecode($xml->variables->effective_caller_id_name);
}
if (isset($xml->variables->effective_caller_id_number)) {
$caller_id_number = urldecode($xml->variables->effective_caller_id_number);
}
$caller_id_destination = urldecode($xml->variables->caller_destination);
foreach ($xml->callflow as $row) {
$caller_id_number = urldecode($row->caller_profile->caller_id_number);
}
if (strlen($caller_id_name) == 0) {
foreach ($xml->callflow as $row) {
$caller_id_name = urldecode($row->caller_profile->caller_id_name);
}
}
//misc //misc
$uuid = urldecode($xml->variables->uuid); $uuid = urldecode($xml->variables->uuid);
$this->array[$key]['xml_cdr_uuid'] = $uuid; $this->array[$key]['xml_cdr_uuid'] = $uuid;