From 9c9507e2e360c00cfecab04f7a1cb26ea21518a7 Mon Sep 17 00:00:00 2001 From: agree <37550360+greenbea@users.noreply.github.com> Date: Sat, 23 Jan 2021 23:47:53 -0500 Subject: [PATCH] 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 --- app/xml_cdr/xml_cdr_details.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/app/xml_cdr/xml_cdr_details.php b/app/xml_cdr/xml_cdr_details.php index dee13f107e..8f9fa52418 100644 --- a/app/xml_cdr/xml_cdr_details.php +++ b/app/xml_cdr/xml_cdr_details.php @@ -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 "\n"; echo " ".escape($app_name)." \n"; echo " ".escape(wordwrap($app_data,75,"\n", true))." \n";