Update xml_cdr.php

This commit is contained in:
FusionPBX 2019-10-07 15:44:05 -06:00 committed by GitHub
parent 3fad9522b7
commit 12b9788a6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 1 deletions

View File

@ -598,10 +598,23 @@ if (!class_exists('xml_cdr')) {
$this->array[$key]['json'] = json_encode($xml);
}
//insert the $extension_uuid
//get the extension_uuid and then add it to the database fields array
if (strlen($xml->variables->extension_uuid) > 0) {
$this->array[$key]['extension_uuid'] = urldecode($xml->variables->extension_uuid);
}
else {
if (strlen($xml->variables->dialed_user) > 0) {
$sql = "select extension_uuid from v_extensions ";
$sql .= "where domain_uuid = :domain_uuid ";
$sql .= "and (extension = :dialed_user or number_alias = :dialed_user) ";
$parameters['domain_uuid'] = $domain_uuid;
$parameters['dialed_user'] = $xml->variables->dialed_user;
$database = new database;
$extension_uuid = $database->select($sql, $parameters, 'column');
$this->array[$key]['extension_uuid'] = $extension_uuid;
unset($parameters);
}
}
//insert the values
if ($this->debug) {