mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-03-19 23:12:15 +00:00
CDR: Updates for PHP 8.1
This commit is contained in:
@@ -1341,7 +1341,7 @@ if (!class_exists('xml_cdr')) {
|
||||
//$parameters['domain_uuid'] = $domain_uuid;
|
||||
$database = new database;
|
||||
$row = $database->select($sql, $parameters, 'row');
|
||||
if (is_array($row)) {
|
||||
if (!empty($row) && is_array($row)) {
|
||||
$record_name = $row['record_name'];
|
||||
$record_path = $row['record_path'];
|
||||
} else {
|
||||
@@ -1354,24 +1354,20 @@ if (!class_exists('xml_cdr')) {
|
||||
$record_file = $record_path.'/'.$record_name;
|
||||
|
||||
//download the file
|
||||
if (!file_exists($record_file)) {
|
||||
if (!file_exists($record_file) || $record_file == '/') {
|
||||
echo "recording not found";
|
||||
return;
|
||||
}
|
||||
|
||||
//content-range
|
||||
if (isset($_SERVER['HTTP_RANGE']) && $_GET['t'] != "bin") {
|
||||
$this->range_download($record_file);
|
||||
}
|
||||
|
||||
ob_clean();
|
||||
//ob_clean();
|
||||
$fd = fopen($record_file, "rb");
|
||||
if ($_GET['t'] == "bin") {
|
||||
header("Content-Type: application/force-download");
|
||||
header("Content-Type: application/octet-stream");
|
||||
header("Content-Type: application/download");
|
||||
header("Content-Description: File Transfer");
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$file_ext = pathinfo($record_name, PATHINFO_EXTENSION);
|
||||
switch ($file_ext) {
|
||||
case "wav" : header("Content-Type: audio/x-wav"); break;
|
||||
@@ -1386,8 +1382,13 @@ if (!class_exists('xml_cdr')) {
|
||||
if ($_GET['t'] == "bin") {
|
||||
header("Content-Length: ".filesize($record_file));
|
||||
}
|
||||
ob_clean();
|
||||
fpassthru($fd);
|
||||
//ob_clean();
|
||||
//fpassthru($fd);
|
||||
|
||||
//content-range
|
||||
if (isset($_SERVER['HTTP_RANGE']) && $_GET['t'] != "bin") {
|
||||
$this->range_download($record_file);
|
||||
}
|
||||
|
||||
} //end download method
|
||||
|
||||
@@ -1488,7 +1489,7 @@ if (!class_exists('xml_cdr')) {
|
||||
* delete records
|
||||
*/
|
||||
public function delete($records) {
|
||||
if (permission_exists($this->permission_prefix.'delete')) {
|
||||
if (!permission_exists($this->permission_prefix.'delete')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1512,7 +1513,7 @@ if (!class_exists('xml_cdr')) {
|
||||
|
||||
//loop through records
|
||||
foreach($records as $x => $record) {
|
||||
if ($record['checked'] != 'true' || !is_uuid($record['uuid'])) {
|
||||
if (empty($record['checked']) || $record['checked'] != 'true' || !is_uuid($record['uuid'])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -255,8 +255,8 @@
|
||||
if (permission_exists('xml_cdr_b_leg')){
|
||||
echo " <select name='leg' class='formfld'>\n";
|
||||
echo " <option value=''></option>\n";
|
||||
echo " <option value='a'>a-leg</option>\n";
|
||||
echo " <option value='b'>b-leg</option>\n";
|
||||
echo " <option value='a' ".(!empty($_REQUEST["leg"]) && $leg == 'a' ? "selected='selected'" : null).">a-leg</option>\n";
|
||||
echo " <option value='b' ".($leg == 'b' ? "selected='selected'" : null).">b-leg</option>\n";
|
||||
echo " </select>\n";
|
||||
}
|
||||
echo " </div>\n";
|
||||
@@ -480,7 +480,7 @@
|
||||
echo " <option value='hangup_cause' ".($order_by == 'desc' ? "selected='selected'" : null).">".$text['label-hangup_cause']."</option>\n";
|
||||
}
|
||||
if (permission_exists('xml_cdr_custom_fields')) {
|
||||
if (is_array($_SESSION['cdr']['field'])) {
|
||||
if (!empty($_SESSION['cdr']['field']) && is_array($_SESSION['cdr']['field'])) {
|
||||
echo " <option value='' disabled='disabled'></option>\n";
|
||||
echo " <optgroup label=\"".$text['label-custom_cdr_fields']."\">\n";
|
||||
foreach ($_SESSION['cdr']['field'] as $field) {
|
||||
@@ -535,7 +535,7 @@
|
||||
$col_count = 0;
|
||||
if (!$archive_request && permission_exists('xml_cdr_delete')) {
|
||||
echo " <th class='checkbox'>\n";
|
||||
echo " <input type='checkbox' id='checkbox_all' name='checkbox_all' onclick='list_all_toggle();' ".($result ?: "style='visibility: hidden;'").">\n";
|
||||
echo " <input type='checkbox' id='checkbox_all' name='checkbox_all' onclick='list_all_toggle();' ".(empty($result) ? "style='visibility: hidden;'" : null).">\n";
|
||||
echo " </th>\n";
|
||||
$col_count++;
|
||||
}
|
||||
@@ -644,6 +644,9 @@
|
||||
$x = 0;
|
||||
foreach ($result as $index => $row) {
|
||||
|
||||
//clear previous variables
|
||||
unset($record_path, $record_name);
|
||||
|
||||
//get the hangup cause
|
||||
$hangup_cause = $row['hangup_cause'];
|
||||
$hangup_cause = str_replace("_", " ", $hangup_cause);
|
||||
@@ -654,7 +657,7 @@
|
||||
$seconds = $row['hangup_cause'] == "ORIGINATOR_CANCEL" ? $row['duration'] : round(($row['billmsec'] / 1000), 0, PHP_ROUND_HALF_UP);
|
||||
|
||||
//determine recording properties
|
||||
if (permission_exists('xml_cdr_recording_play') || permission_exists('xml_cdr_recording_download')) {
|
||||
if (!empty($row['record_path']) && !empty($row['record_name']) && permission_exists('xml_cdr_recording') && (permission_exists('xml_cdr_recording_play') || permission_exists('xml_cdr_recording_download'))) {
|
||||
$record_path = $row['record_path'];
|
||||
$record_name = $row['record_name'];
|
||||
//$record_name = strtolower(pathinfo($tmp_name, PATHINFO_BASENAME));
|
||||
@@ -670,7 +673,7 @@
|
||||
$content = '';
|
||||
|
||||
//recording playback
|
||||
if (permission_exists('xml_cdr_recording_play') && $record_path != '') {
|
||||
if (permission_exists('xml_cdr_recording_play')) {
|
||||
$content .= "<tr class='list-row' id='recording_progress_bar_".$row['xml_cdr_uuid']."' style='display: none;'><td class='playback_progress_bar_background' style='padding: 0; border-bottom: none; overflow: hidden;' colspan='".$col_count."'><span class='playback_progress_bar' id='recording_progress_".$row['xml_cdr_uuid']."'></span></td></tr>\n";
|
||||
$content .= "<tr class='list-row' style='display: none;'><td></td></tr>\n"; // dummy row to maintain alternating background color
|
||||
}
|
||||
@@ -743,10 +746,10 @@
|
||||
$content .= " <td class='middle no-link no-wrap hide-md-dn'>";
|
||||
$content .= " <a href=\"javascript:void(0)\" onclick=\"send_cmd('".PROJECT_PATH."/app/click_to_call/click_to_call.php?src_cid_name=".urlencode(escape($row['caller_id_name']))."&src_cid_number=".urlencode(escape($row['caller_id_number']))."&dest_cid_name=".urlencode($_SESSION['user']['extension'][0]['outbound_caller_id_name'])."&dest_cid_number=".urlencode($_SESSION['user']['extension'][0]['outbound_caller_id_number'])."&src=".urlencode($_SESSION['user']['extension'][0]['user'])."&dest=".urlencode(escape($row['caller_destination']))."&rec=false&ringback=us-ring&auto_answer=true');\">\n";
|
||||
if (is_numeric($row['caller_destination'])) {
|
||||
$content .= " ".format_phone(escape(substr($row['caller_destination'], 0, 20))).' ';
|
||||
$content .= " ".escape(format_phone(substr($row['caller_destination'], 0, 20))).' ';
|
||||
}
|
||||
else {
|
||||
$content .= " ".escape(substr($row['caller_destination'], 0, 20)).' ';
|
||||
$content .= " ".escape(substr($row['caller_destination'] ?? '', 0, 20)).' ';
|
||||
}
|
||||
$content .= " </a>";
|
||||
$content .= " </td>\n";
|
||||
@@ -756,7 +759,7 @@
|
||||
$content .= " <td class='middle no-link no-wrap'>";
|
||||
$content .= " <a href=\"javascript:void(0)\" onclick=\"send_cmd('".PROJECT_PATH."/app/click_to_call/click_to_call.php?src_cid_name=".urlencode(escape($row['destination_number']))."&src_cid_number=".urlencode(escape($row['destination_number']))."&dest_cid_name=".urlencode($_SESSION['user']['extension'][0]['outbound_caller_id_name'])."&dest_cid_number=".urlencode($_SESSION['user']['extension'][0]['outbound_caller_id_number'])."&src=".urlencode($_SESSION['user']['extension'][0]['user'])."&dest=".urlencode(escape($row['destination_number']))."&rec=false&ringback=us-ring&auto_answer=true');\">\n";
|
||||
if (is_numeric($row['destination_number'])) {
|
||||
$content .= format_phone(escape(substr($row['destination_number'], 0, 20)))."\n";
|
||||
$content .= escape(format_phone(substr($row['destination_number'], 0, 20)))."\n";
|
||||
}
|
||||
else {
|
||||
$content .= escape(substr($row['destination_number'], 0, 20))."\n";
|
||||
@@ -766,7 +769,7 @@
|
||||
}
|
||||
//recording
|
||||
if (permission_exists('xml_cdr_recording') && (permission_exists('xml_cdr_recording_play') || permission_exists('xml_cdr_recording_download'))) {
|
||||
if ($record_path != '') {
|
||||
if (!empty($record_path) || !empty($record_name)) {
|
||||
$content .= " <td class='middle button center no-link no-wrap'>";
|
||||
if (permission_exists('xml_cdr_recording_play')) {
|
||||
$content .= "<audio id='recording_audio_".escape($row['xml_cdr_uuid'])."' style='display: none;' preload='none' ontimeupdate=\"update_progress('".escape($row['xml_cdr_uuid'])."')\" onended=\"recording_reset('".escape($row['xml_cdr_uuid'])."');\" src=\"download.php?id=".escape($row['xml_cdr_uuid'])."&t=record\" type='".escape($record_type)."'></audio>";
|
||||
@@ -783,7 +786,7 @@
|
||||
}
|
||||
//custom cdr fields
|
||||
if (permission_exists('xml_cdr_custom_fields')) {
|
||||
if (is_array($_SESSION['cdr']['field'])) {
|
||||
if (!empty($_SESSION['cdr']['field']) && is_array($_SESSION['cdr']['field'])) {
|
||||
foreach ($_SESSION['cdr']['field'] as $field) {
|
||||
$array = explode(",", $field);
|
||||
$field_name = $array[count($array) - 1];
|
||||
@@ -800,7 +803,7 @@
|
||||
}
|
||||
//tta (time to answer)
|
||||
if (permission_exists('xml_cdr_tta')) {
|
||||
$content .= " <td class='middle right hide-md-dn'>".(($row['tta'] >= 0) ? $row['tta']."s" : " ")."</td>\n";
|
||||
$content .= " <td class='middle right hide-md-dn'>".(!empty($row['tta']) && $row['tta'] >= 0 ? $row['tta']."s" : " ")."</td>\n";
|
||||
}
|
||||
//duration
|
||||
if (permission_exists('xml_cdr_duration')) {
|
||||
@@ -816,7 +819,7 @@
|
||||
$title = " title='".$text['label-mos_score-'.round($row['rtp_audio_in_mos'])]."'";
|
||||
$value = $row['rtp_audio_in_mos'];
|
||||
}
|
||||
$content .= " <td class='middle center hide-md-dn' ".$title.">".$value."</td>\n";
|
||||
$content .= " <td class='middle center hide-md-dn' ".($title ?? '').">".($value ?? '')."</td>\n";
|
||||
}
|
||||
//call result/status
|
||||
if (permission_exists("xml_cdr_status")) {
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2019
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2023
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
@@ -63,9 +63,9 @@
|
||||
$parameters['xml_cdr_uuid'] = $uuid;
|
||||
$database = new database;
|
||||
$row = $database->select($sql, $parameters, 'row');
|
||||
if (is_array($row) && @sizeof($row) != 0) {
|
||||
if (!empty($row) && is_array($row) && @sizeof($row) != 0) {
|
||||
$start_stamp = trim($row["start_stamp"]);
|
||||
$xml_string = trim($row["xml"]);
|
||||
$xml_string = trim($row["xml"] ?? '');
|
||||
$json_string = trim($row["json"]);
|
||||
}
|
||||
unset($sql, $parameters, $row);
|
||||
@@ -136,11 +136,11 @@
|
||||
//get the variables
|
||||
$xml_cdr_uuid = urldecode($array["variables"]["uuid"]);
|
||||
$direction = urldecode($array["variables"]["call_direction"]);
|
||||
$language = urldecode($array["variables"]["language"]);
|
||||
$language = urldecode($array["variables"]["language"] ?? '');
|
||||
$start_epoch = urldecode($array["variables"]["start_epoch"]);
|
||||
$start_stamp = urldecode($array["variables"]["start_stamp"]);
|
||||
$start_uepoch = urldecode($array["variables"]["start_uepoch"]);
|
||||
$answer_stamp = urldecode($array["variables"]["answer_stamp"]);
|
||||
$answer_stamp = urldecode($array["variables"]["answer_stamp"] ?? '');
|
||||
$answer_epoch = urldecode($array["variables"]["answer_epoch"]);
|
||||
$answer_uepoch = urldecode($array["variables"]["answer_uepoch"]);
|
||||
$end_epoch = urldecode($array["variables"]["end_epoch"]);
|
||||
@@ -150,10 +150,10 @@
|
||||
$mduration = urldecode($array["variables"]["mduration"]);
|
||||
$billsec = urldecode($array["variables"]["billsec"]);
|
||||
$billmsec = urldecode($array["variables"]["billmsec"]);
|
||||
$bridge_uuid = urldecode($array["variables"]["bridge_uuid"]);
|
||||
$read_codec = urldecode($array["variables"]["read_codec"]);
|
||||
$write_codec = urldecode($array["variables"]["write_codec"]);
|
||||
$remote_media_ip = urldecode($array["variables"]["remote_media_ip"]);
|
||||
$bridge_uuid = urldecode($array["variables"]["bridge_uuid"] ?? '');
|
||||
$read_codec = urldecode($array["variables"]["read_codec"] ?? '');
|
||||
$write_codec = urldecode($array["variables"]["write_codec"] ?? '');
|
||||
$remote_media_ip = urldecode($array["variables"]["remote_media_ip"] ?? '');
|
||||
$hangup_cause = urldecode($array["variables"]["hangup_cause"]);
|
||||
$hangup_cause_q850 = urldecode($array["variables"]["hangup_cause_q850"]);
|
||||
if (!isset($array["callflow"][0])) {
|
||||
@@ -179,9 +179,9 @@
|
||||
else {
|
||||
$tmp_end_stamp = urldecode($row["times"]["transfer_time"]) / 1000000;
|
||||
}
|
||||
$call_flow_summary[$x]["start_stamp"] = date("Y-m-d H:i:s", $tmp_start_stamp);
|
||||
$call_flow_summary[$x]["end_stamp"] = date("Y-m-d H:i:s", $tmp_end_stamp);
|
||||
$call_flow_summary[$x]["duration"] = gmdate("G:i:s", $tmp_end_stamp - $tmp_start_stamp);
|
||||
$call_flow_summary[$x]["start_stamp"] = date("Y-m-d H:i:s", (int) $tmp_start_stamp);
|
||||
$call_flow_summary[$x]["end_stamp"] = date("Y-m-d H:i:s", (int) $tmp_end_stamp);
|
||||
$call_flow_summary[$x]["duration"] = gmdate("G:i:s", (int) $tmp_end_stamp - (int) $tmp_start_stamp);
|
||||
$x++;
|
||||
}
|
||||
unset($x);
|
||||
@@ -283,9 +283,9 @@
|
||||
$c = 0;
|
||||
$row_style["0"] = "row_style0";
|
||||
$row_style["1"] = "row_style1";
|
||||
if (is_array($array["call-stats"])) {
|
||||
if (is_array($array["call-stats"]['audio'])) {
|
||||
foreach($array["call-stats"]['audio'] as $audio_direction => $stat) {
|
||||
if (!empty($array["call-stats"]) && is_array($array["call-stats"])) {
|
||||
if (!empty($array["call-stats"]['audio']) && is_array($array["call-stats"]['audio'])) {
|
||||
foreach ($array["call-stats"]['audio'] as $audio_direction => $stat) {
|
||||
echo " <table width='95%' border='0' cellpadding='0' cellspacing='0'>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td><b>".$text['label-call-stats'].": ".$audio_direction."</b> </td>\n";
|
||||
@@ -298,7 +298,7 @@
|
||||
echo " <th width='30%'>".$text['label-name']."</th>\n";
|
||||
echo " <th width='70%'>".$text['label-value']."</th>\n";
|
||||
echo " </tr>\n";
|
||||
foreach($stat as $key => $value) {
|
||||
foreach ($stat as $key => $value) {
|
||||
$value = urldecode($value);
|
||||
echo "<tr >\n";
|
||||
echo " <td valign='top' align='left' class='".$row_style[$c]."'>".escape($key)."</td>\n";
|
||||
@@ -519,16 +519,21 @@
|
||||
echo " <td> </td>\n";
|
||||
echo " </tr>\n";
|
||||
echo "</table>\n";
|
||||
|
||||
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <th width='30%'>".$text['label-name']."</th>\n";
|
||||
echo " <th width='70%'>".$text['label-data']."</th>\n";
|
||||
echo " </tr>\n";
|
||||
if (is_array($row["extension"]["application"])) {
|
||||
foreach ($row["extension"]["application"] as $tmp_row) {
|
||||
$app_name = $tmp_row["@attributes"]["app_name"];
|
||||
$app_data = urldecode($tmp_row["@attributes"]["app_data"]);
|
||||
foreach ($row["extension"]["application"] as $key => $tmp_row) {
|
||||
if (!is_numeric($key)) {
|
||||
$app_name = $tmp_row["app_name"] ?? '';
|
||||
$app_data = urldecode($tmp_row["app_data"] ?? '');
|
||||
}
|
||||
else {
|
||||
$app_name = $tmp_row["@attributes"]["app_name"] ?? '';
|
||||
$app_data = urldecode($tmp_row["@attributes"]["app_data"] ?? '');
|
||||
}
|
||||
echo " <tr >\n";
|
||||
echo " <td valign='top' align='left' class='".$row_style[$c]."'>".escape($app_name)." </td>\n";
|
||||
echo " <td valign='top' align='left' class='".$row_style[$c]."'>".escape(wordwrap($app_data,75,"\n", true))." </td>\n";
|
||||
@@ -555,36 +560,63 @@
|
||||
echo " <th width='70%'>".$text['label-value']."</th>\n";
|
||||
echo " </tr>\n";
|
||||
if (is_array($row["caller_profile"])) {
|
||||
foreach($row["caller_profile"] as $key => $value) {
|
||||
if (is_array($value)) { $value = implode($value); }
|
||||
$value = urldecode($value);
|
||||
echo " <tr >\n";
|
||||
if ($key != "originatee") {
|
||||
if (is_array($value)) { $value = implode($value); }
|
||||
$value = urldecode($value);
|
||||
foreach ($row["caller_profile"] as $key => $value) {
|
||||
echo " <tr>\n";
|
||||
if ($key != "originatee" && $key != "origination") {
|
||||
if (is_array($value)) {
|
||||
$value = implode('', $value);
|
||||
}
|
||||
else {
|
||||
$value = urldecode($value);
|
||||
}
|
||||
echo " <td valign='top' align='left' class='".$row_style[$c]."'>".escape($key)." </td>\n";
|
||||
echo " <td valign='top' align='left' class='".$row_style[$c]."'>".escape(wordwrap($value,75,"\n", true))." </td>\n";
|
||||
if ($key == "uuid") {
|
||||
echo " <td valign='top' align='left' class='".$row_style[$c]."'><a href='xml_cdr_details.php?id=".urlencode($value)."'>".escape($value)."</a> </td>\n";
|
||||
}
|
||||
else {
|
||||
echo " <td valign='top' align='left' class='".$row_style[$c]."'>".escape(wordwrap($value,75,"\n", true))." </td>\n";
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo " <td valign='top' align='left' class='".$row_style[$c]."'>".escape($key)." </td>\n";
|
||||
echo " <td class='".$row_style[$c]."'>\n";
|
||||
echo " <table width='100%'>\n";
|
||||
if (isset($child["originatee_caller_profile"])) {
|
||||
foreach($child["originatee_caller_profile"] as $key => $value) {
|
||||
//print_r($tmp_child);
|
||||
echo " <tr >\n";
|
||||
echo " <td valign='top' align='left' width='20%' class='".$row_style[$c]."'>".escape($key)." </td>\n";
|
||||
if ($key != "uuid") {
|
||||
echo " <td valign='top' align='left' class='".$row_style[$c]."'>".escape(wordwrap($value,75,"\n", true))." </td>\n";
|
||||
if (isset($value[$key."_caller_profile"]) && is_array($value[$key."_caller_profile"])) {
|
||||
echo " <table width='100%'>\n";
|
||||
foreach ($value[$key."_caller_profile"] as $key_2 => $value_2) {
|
||||
if (is_numeric($key_2)) {
|
||||
$group_output = false;
|
||||
foreach ($value_2 as $key_3 => $value_3) {
|
||||
echo " <tr>\n";
|
||||
if ($group_output == false) {
|
||||
echo " <td valign='top' align='left' width='10%' rowspan='".sizeof($value[$key."_caller_profile"][$key_2])."' class='".$row_style[$c]."'>".escape($key_2)." </td>\n";
|
||||
$group_output = true;
|
||||
}
|
||||
echo " <td valign='top' align='left' width='20%' class='".$row_style[$c]."'>".escape($key_3)." </td>\n";
|
||||
if (is_array($value_3)) {
|
||||
echo " <td valign='top' align='left' class='".$row_style[$c]."'>".escape(implode('', $value_3))." </td>\n";
|
||||
}
|
||||
else {
|
||||
echo " <td valign='top' align='left' class='".$row_style[$c]."'>".escape(wordwrap($value_3,75,"\n", true))." </td>\n";
|
||||
}
|
||||
echo " </tr>\n";
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo " <td valign='top' align='left' class='".$row_style[$c]."'><a href='xml_cdr_details.php?id=".urlencode($value)."'>".escape($value)."</a> </td>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td valign='top' align='left' width='20%' class='".$row_style[$c]."'>".escape($key_2)." </td>\n";
|
||||
if (is_array($value_2)) {
|
||||
echo " <td valign='top' align='left' class='".$row_style[$c]."'>".escape(implode('', $value_2))." </td>\n";
|
||||
}
|
||||
else {
|
||||
echo " <td valign='top' align='left' class='".$row_style[$c]."'>".escape(wordwrap($value_2,75,"\n", true))." </td>\n";
|
||||
}
|
||||
echo " </tr>\n";
|
||||
}
|
||||
echo " </tr>\n";
|
||||
}
|
||||
unset($key_2, $value_2);
|
||||
echo " </table>\n";
|
||||
echo " </td>\n";
|
||||
}
|
||||
echo " </table>\n";
|
||||
echo " </td>\n";
|
||||
}
|
||||
echo "</tr>\n";
|
||||
$c = $c ? 0 : 1;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2020
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2023
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
@@ -47,7 +47,7 @@
|
||||
|
||||
//additional includes
|
||||
$rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50;
|
||||
$archive_request = $_POST['archive_request'] == 'true' ? true : false;
|
||||
$archive_request = isset($_POST['archive_request']) && $_POST['archive_request'] == 'true' ? true : false;
|
||||
require_once "xml_cdr_inc.php";
|
||||
|
||||
//get the format
|
||||
@@ -159,7 +159,7 @@
|
||||
$data_head .= '<td width="8%" align="right"><b>'.$text['label-billsec'].'</b></td>';
|
||||
$data_head .= '<td width="5%" align="right"><b>'."PDD".'</b></td>';
|
||||
$data_head .= '<td width="5%" align="center"><b>'."MOS".'</b></td>';
|
||||
if (is_array($_SESSION['cdr']['field'])) {
|
||||
if (!empty($_SESSION['cdr']['field']) && is_array($_SESSION['cdr']['field'])) {
|
||||
foreach ($_SESSION['cdr']['field'] as $field) {
|
||||
$array = explode(",", $field);
|
||||
$field_name = end($array);
|
||||
@@ -188,7 +188,7 @@
|
||||
$p = 0; // per page counter
|
||||
if (sizeof($result) > 0) {
|
||||
foreach ($result as $cdr_num => $fields) {
|
||||
$data_body[$p] .= '<tr>';
|
||||
$data_body[$p] = '<tr>';
|
||||
$data_body[$p] .= '<td>'.$text['label-'.$fields['direction']].'</td>';
|
||||
$data_body[$p] .= '<td>'.$fields['caller_id_name'].'</td>';
|
||||
$data_body[$p] .= '<td>'.$fields['caller_id_number'].'</td>';
|
||||
@@ -214,7 +214,7 @@
|
||||
}
|
||||
$data_body[$p] .= '</td>';
|
||||
|
||||
if (is_array($_SESSION['cdr']['field'])) {
|
||||
if (!empty($_SESSION['cdr']['field']) && is_array($_SESSION['cdr']['field'])) {
|
||||
foreach ($_SESSION['cdr']['field'] as $field) {
|
||||
$array = explode(",", $field);
|
||||
$field_name = end($array);
|
||||
@@ -278,7 +278,7 @@
|
||||
$data_footer .= '<td><b>'.$text['label-average'].'</b></td>';
|
||||
$data_footer .= '<td colspan="4"></td>';
|
||||
$data_footer .= '<td align="right"><b>'.round(($total['tta'] / $z), 1).'</b></td>';
|
||||
$data_footer .= '<td align="right"><b>'.gmdate("G:i:s", ($total['duration'] / $z)).'</b></td>';
|
||||
$data_footer .= '<td align="right"><b>'.gmdate("G:i:s", floor($total['duration'] / $z)).'</b></td>';
|
||||
$data_footer .= '<td align="right"><b>'.gmdate("G:i:s", round($total['billmsec'] / $z / 1000, 0)).'</b></td>';
|
||||
$data_footer .= '<td align="right"><b>'.number_format(round(($total['pdd_ms'] / $z / 1000), 2), 2).'s</b></td>';
|
||||
$data_footer .= '<td align="right"><b>'.round(($total['rtp_audio_in_mos'] / $z), 2).'</b></td>';
|
||||
|
||||
@@ -294,13 +294,13 @@
|
||||
$sql .= "c.rtp_audio_in_mos, \n";
|
||||
}
|
||||
$sql .= "(c.answer_epoch - c.start_epoch) as tta ";
|
||||
if ($_REQUEST['show'] == "all" && permission_exists('xml_cdr_all')) {
|
||||
if (!empty($_REQUEST['show']) && $_REQUEST['show'] == "all" && permission_exists('xml_cdr_all')) {
|
||||
$sql .= ", c.domain_name \n";
|
||||
}
|
||||
$sql .= "from v_xml_cdr as c \n";
|
||||
$sql .= "left join v_extensions as e on e.extension_uuid = c.extension_uuid \n";
|
||||
$sql .= "inner join v_domains as d on d.domain_uuid = c.domain_uuid \n";
|
||||
if ($_REQUEST['show'] == "all" && permission_exists('xml_cdr_all')) {
|
||||
if (!empty($_REQUEST['show']) && $_REQUEST['show'] == "all" && permission_exists('xml_cdr_all')) {
|
||||
$sql .= "where true \n";
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Copyright (C) 2008-2018
|
||||
Copyright (C) 2008-2023
|
||||
All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
@@ -164,7 +164,7 @@
|
||||
$result_e = $database->select($sql, $parameters, 'all');
|
||||
if (is_array($result_e) && @sizeof($result_e) != 0) {
|
||||
foreach ($result_e as &$row) {
|
||||
$selected = ($row['extension_uuid'] == $caller_extension_uuid) ? "selected" : null;
|
||||
$selected = (!empty($caller_extension_uuid) && $row['extension_uuid'] == $caller_extension_uuid) ? "selected" : null;
|
||||
echo " <option value='".escape($row['extension_uuid'])."' ".escape($selected).">".((is_numeric($row['extension'])) ? escape($row['extension']) : escape($row['number_alias'])." (".escape($row['extension']).")")."</option>";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user