Fix xml_cdr_details fix application log

When there's a single app in the app log it's saved as an single object in the json not as an array of objects
This commit is contained in:
agree
2021-01-23 23:47:53 -05:00
committed by GitHub
parent 80c51cc2e2
commit 9c9507e2e3

View File

@@ -388,8 +388,16 @@
//foreach($array["variables"] as $key => $value) {
if (is_array($array["app_log"]["application"])) {
foreach ($array["app_log"]["application"] as $row) {
$app_name = $row["@attributes"]["app_name"];
$app_data = urldecode($row["@attributes"]["app_data"]);
//single app
if ($key == "@attributes") {
$app_name = $row["app_name"];
$app_data = urldecode($row["app_data"]);
}
//multiple apps
else {
$app_name = $row["@attributes"]["app_name"];
$app_data = urldecode($row["@attributes"]["app_data"]);
}
echo "<tr >\n";
echo " <td valign='top' align='left' class='".$row_style[$c]."'>".escape($app_name)."&nbsp;</td>\n";
echo " <td valign='top' align='left' class='".$row_style[$c]."'>".escape(wordwrap($app_data,75,"\n", true))."&nbsp;</td>\n";