CDR: Updates for PHP 8.1
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user