Update v_xml_cdr_import.php

This commit is contained in:
FusionPBX 2019-10-07 14:55:20 -06:00 committed by GitHub
parent 3a3abc1c03
commit 37126500ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 16 deletions

View File

@ -265,7 +265,6 @@
$sql .= "where domain_name = :domain_name ";
$parameters['domain_name'] = $domain_name;
}
$database = new database;
$domain_uuid = $database->select($sql, $parameters, 'column');
unset($parameters);
}
@ -312,24 +311,20 @@
$database->fields['xml'] = $xml_string;
}
//insert the $extension_uuid
//get the extension_uuid and then add it to the database fields array
if (strlen($xml->variables->extension_uuid) > 0) {
$database->fields['extension_uuid'] = urldecode($xml->variables->extension_uuid);
}
else {
$dialed_user = $xml->variables->dialed_user;
if (strlen($dialed_user) > 0 && is_numeric($dialed_user)) {
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'] = $dialed_user;
$database = new database;
$parameters['dialed_user'] = $xml->variables->dialed_user;
$extension_uuid = $database->select($sql, $parameters, 'column');
unset($parameters);
if (is_uuid($extension_uuid)) {
$database->fields['extension_uuid'] = $extension_uuid;
}
unset($parameters);
}
}
@ -393,7 +388,8 @@
$record_path = $path;
$record_name = $bridge_uuid.'.wav';
$record_length = urldecode($xml->variables->duration);
} elseif (file_exists($path.'/'.$bridge_uuid.'.mp3')) {
}
elseif (file_exists($path.'/'.$bridge_uuid.'.mp3')) {
$record_path = $path;
$record_name = $bridge_uuid.'.mp3';
$record_length = urldecode($xml->variables->duration);
@ -405,7 +401,8 @@
$record_path = $path;
$record_name = $uuid.'.wav';
$record_length = urldecode($xml->variables->duration);
} elseif (file_exists($path.'/'.$uuid.'.mp3')) {
}
elseif (file_exists($path.'/'.$uuid.'.mp3')) {
$record_path = $path;
$record_name = $uuid.'.mp3';
$record_length = urldecode($xml->variables->duration);