2012-06-04 16:58:40 +02:00
|
|
|
<?php
|
|
|
|
|
/*
|
|
|
|
|
FusionPBX
|
|
|
|
|
Version: MPL 1.1
|
|
|
|
|
|
|
|
|
|
The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
|
1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
|
the License. You may obtain a copy of the License at
|
|
|
|
|
http://www.mozilla.org/MPL/
|
|
|
|
|
|
|
|
|
|
Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
|
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
|
for the specific language governing rights and limitations under the
|
|
|
|
|
License.
|
|
|
|
|
|
|
|
|
|
The Original Code is FusionPBX
|
|
|
|
|
|
|
|
|
|
The Initial Developer of the Original Code is
|
|
|
|
|
Mark J Crane <markjcrane@fusionpbx.com>
|
|
|
|
|
Portions created by the Initial Developer are Copyright (C) 2008-2012
|
|
|
|
|
the Initial Developer. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
Contributor(s):
|
|
|
|
|
Mark J Crane <markjcrane@fusionpbx.com>
|
|
|
|
|
*/
|
|
|
|
|
include "root.php";
|
2013-07-06 08:03:27 +02:00
|
|
|
require_once "resources/require.php";
|
2013-07-06 07:50:55 +02:00
|
|
|
require_once "resources/check_auth.php";
|
2012-10-24 09:35:01 +02:00
|
|
|
|
2012-06-04 16:58:40 +02:00
|
|
|
if (permission_exists('xml_cdr_view')) {
|
|
|
|
|
//access granted
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo "access denied";
|
|
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
|
2012-10-24 09:35:01 +02:00
|
|
|
//add multi-lingual support
|
2015-01-18 11:04:43 +01:00
|
|
|
$language = new text;
|
|
|
|
|
$text = $language->get();
|
2012-10-06 20:02:17 +02:00
|
|
|
|
2012-06-04 16:58:40 +02:00
|
|
|
//get the http values and set them to a variable
|
|
|
|
|
if (strlen($_REQUEST["uuid"]) > 0) {
|
|
|
|
|
$uuid = trim($_REQUEST["uuid"]);
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-14 09:41:22 +02:00
|
|
|
//get the cdr string from the database
|
2012-06-04 16:58:40 +02:00
|
|
|
$sql = "select * from v_xml_cdr ";
|
|
|
|
|
$sql .= "where domain_uuid = '$domain_uuid' ";
|
|
|
|
|
$sql .= "and uuid = '$uuid' ";
|
|
|
|
|
$row = $db->query($sql)->fetch();
|
|
|
|
|
$start_stamp = trim($row["start_stamp"]);
|
2014-06-14 09:41:22 +02:00
|
|
|
$xml_string = trim($row["xml"]);
|
|
|
|
|
$json_string = trim($row["json"]);
|
2012-06-04 16:58:40 +02:00
|
|
|
//print_r($row);
|
|
|
|
|
|
2014-06-14 09:41:22 +02:00
|
|
|
//get the format
|
|
|
|
|
if (strlen($xml_string) > 0) {
|
|
|
|
|
$format = "xml";
|
|
|
|
|
}
|
|
|
|
|
if (strlen($json_string) > 0) {
|
|
|
|
|
$format = "json";
|
|
|
|
|
}
|
|
|
|
|
|
2012-06-04 16:58:40 +02:00
|
|
|
//get cdr from the file system
|
2014-06-14 09:41:22 +02:00
|
|
|
if ($format != "xml" || $format != "json") {
|
2012-06-04 16:58:40 +02:00
|
|
|
$tmp_time = strtotime($start_stamp);
|
|
|
|
|
$tmp_year = date("Y", $tmp_time);
|
|
|
|
|
$tmp_month = date("M", $tmp_time);
|
|
|
|
|
$tmp_day = date("d", $tmp_time);
|
|
|
|
|
$tmp_dir = $_SESSION['switch']['log']['dir'].'/xml_cdr/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day;
|
2014-06-14 09:41:22 +02:00
|
|
|
if (file_exists($tmp_dir.'/'.$uuid.'.json')) {
|
|
|
|
|
$format = "json";
|
2014-06-22 01:49:21 +02:00
|
|
|
$json_string = file_get_contents($tmp_dir.'/'.$uuid.'.json');
|
2014-06-14 09:41:22 +02:00
|
|
|
}
|
|
|
|
|
if (file_exists($tmp_dir.'/'.$uuid.'.xml')) {
|
|
|
|
|
$format = "xml";
|
|
|
|
|
$xml_string = file_get_contents($tmp_dir.'/'.$uuid.'.xml');
|
|
|
|
|
}
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//parse the xml to get the call detail record info
|
|
|
|
|
try {
|
2014-06-14 09:41:22 +02:00
|
|
|
if ($format == 'json') {
|
2014-06-14 10:00:10 +02:00
|
|
|
$array = json_decode($json_string,true);
|
2014-06-14 09:41:22 +02:00
|
|
|
}
|
2014-06-14 10:00:10 +02:00
|
|
|
if ($format == 'xml') {
|
|
|
|
|
$array = json_decode(json_encode((array)simplexml_load_string($xml_string)),true);
|
2014-06-14 09:41:22 +02:00
|
|
|
}
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
|
|
|
|
catch(Exception $e) {
|
|
|
|
|
echo $e->getMessage();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//get the header
|
2013-07-06 08:29:50 +02:00
|
|
|
require_once "resources/header.php";
|
2012-06-04 16:58:40 +02:00
|
|
|
|
|
|
|
|
//page title and description
|
|
|
|
|
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
|
|
|
|
echo "<tr>\n";
|
2012-10-24 09:35:01 +02:00
|
|
|
echo "<td width='30%' align='left' valign='top' nowrap='nowrap'><b>".$text['title2']."</b></td>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "<td width='70%' align='right' valign='top'>\n";
|
2015-02-20 00:28:40 +01:00
|
|
|
echo " <input type='button' class='btn' name='' alt='back' onclick=\"window.location='xml_cdr.php".(($_SESSION['xml_cdr']['last_query'] != '') ? "?".$_SESSION['xml_cdr']['last_query'] : null)."'\" value='".$text['button-back']."'>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td align='left' colspan='2'>\n";
|
2012-10-24 09:35:01 +02:00
|
|
|
echo "".$text['description-5']." \n";
|
|
|
|
|
echo "".$text['description-6']." \n";
|
|
|
|
|
echo "".$text['description-7']." \n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
echo "</table>\n";
|
|
|
|
|
echo "<br />\n";
|
|
|
|
|
echo "<br />\n";
|
|
|
|
|
|
|
|
|
|
//detail summary
|
2014-06-14 10:27:21 +02:00
|
|
|
//get the variables
|
|
|
|
|
$uuid = check_str(urldecode($array["variables"]["uuid"]));
|
|
|
|
|
$direction = check_str(urldecode($array["channel_data"]["direction"]));
|
|
|
|
|
$language = check_str(urldecode($array["variables"]["language"]));
|
|
|
|
|
$start_epoch = check_str(urldecode($array["variables"]["start_epoch"]));
|
|
|
|
|
$start_stamp = check_str(urldecode($array["variables"]["start_stamp"]));
|
|
|
|
|
$start_uepoch = check_str(urldecode($array["variables"]["start_uepoch"]));
|
|
|
|
|
$answer_stamp = check_str(urldecode($array["variables"]["answer_stamp"]));
|
|
|
|
|
$answer_epoch = check_str(urldecode($array["variables"]["answer_epoch"]));
|
|
|
|
|
$answer_uepoch = check_str(urldecode($array["variables"]["answer_uepoch"]));
|
|
|
|
|
$end_epoch = check_str(urldecode($array["variables"]["end_epoch"]));
|
|
|
|
|
$end_uepoch = check_str(urldecode($array["variables"]["end_uepoch"]));
|
|
|
|
|
$end_stamp = check_str(urldecode($array["variables"]["end_stamp"]));
|
|
|
|
|
$duration = check_str(urldecode($array["variables"]["duration"]));
|
|
|
|
|
$mduration = check_str(urldecode($array["variables"]["mduration"]));
|
|
|
|
|
$billsec = check_str(urldecode($array["variables"]["billsec"]));
|
|
|
|
|
$billmsec = check_str(urldecode($array["variables"]["billmsec"]));
|
|
|
|
|
$bridge_uuid = check_str(urldecode($array["variables"]["bridge_uuid"]));
|
|
|
|
|
$read_codec = check_str(urldecode($array["variables"]["read_codec"]));
|
|
|
|
|
$write_codec = check_str(urldecode($array["variables"]["write_codec"]));
|
|
|
|
|
$remote_media_ip = check_str(urldecode($array["variables"]["remote_media_ip"]));
|
|
|
|
|
$hangup_cause = check_str(urldecode($array["variables"]["hangup_cause"]));
|
|
|
|
|
$hangup_cause_q850 = check_str(urldecode($array["variables"]["hangup_cause_q850"]));
|
2014-06-14 11:30:53 +02:00
|
|
|
if (!isset($array["callflow"][0])) {
|
|
|
|
|
$tmp = $array["callflow"];
|
|
|
|
|
unset($array["callflow"]);
|
|
|
|
|
$array["callflow"][0] = $tmp;
|
|
|
|
|
}
|
2012-06-04 16:58:40 +02:00
|
|
|
$x = 0;
|
2014-06-14 10:27:21 +02:00
|
|
|
foreach ($array["callflow"] as $row) {
|
2012-06-04 16:58:40 +02:00
|
|
|
if ($x == 0) {
|
2014-06-14 10:27:21 +02:00
|
|
|
$destination_number = check_str(urldecode($row["caller_profile"]["destination_number"]));
|
|
|
|
|
$context = check_str(urldecode($row["caller_profile"]["context"]));
|
|
|
|
|
$network_addr = check_str(urldecode($row["caller_profile"]["network_addr"]));
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
2014-06-14 10:29:57 +02:00
|
|
|
$caller_id_name = check_str(urldecode($row["caller_profile"]["caller_id_name"]));
|
2014-06-14 10:27:21 +02:00
|
|
|
$caller_id_number = check_str(urldecode($row["caller_profile"]["caller_id_number"]));
|
2012-06-04 16:58:40 +02:00
|
|
|
$x++;
|
|
|
|
|
}
|
|
|
|
|
unset($x);
|
2014-06-14 11:30:53 +02:00
|
|
|
|
2012-06-04 16:58:40 +02:00
|
|
|
|
|
|
|
|
$tmp_year = date("Y", strtotime($start_stamp));
|
|
|
|
|
$tmp_month = date("M", strtotime($start_stamp));
|
|
|
|
|
$tmp_day = date("d", strtotime($start_stamp));
|
|
|
|
|
|
|
|
|
|
$c = 0;
|
|
|
|
|
$row_style["0"] = "row_style0";
|
|
|
|
|
$row_style["1"] = "row_style1";
|
|
|
|
|
|
|
|
|
|
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
|
|
|
|
echo "<tr>\n";
|
2012-10-24 09:35:01 +02:00
|
|
|
echo "<td align='left'><b>".$text['label-summary']."</b> </td>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "<td></td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
echo "</table>\n";
|
|
|
|
|
|
|
|
|
|
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
|
|
|
|
echo "<tr>\n";
|
2012-10-24 09:35:01 +02:00
|
|
|
echo "<th>".$text['table-direction']."</th>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
//echo "<th>Language</th>\n";
|
|
|
|
|
//echo "<th>Context</th>\n";
|
2012-10-24 09:35:01 +02:00
|
|
|
echo "<th>".$text['table-name']."</th>\n";
|
|
|
|
|
echo "<th>".$text['table-download']."</th>\n";
|
|
|
|
|
echo "<th>".$text['label-destination']."</th>\n";
|
|
|
|
|
echo "<th>".$text['label-start']."</th>\n";
|
|
|
|
|
echo "<th>".$text['table-end']."</th>\n";
|
2014-06-16 20:12:21 +02:00
|
|
|
echo "<th>".$text['label-duration']."</th>\n";
|
2012-10-24 09:35:01 +02:00
|
|
|
echo "<th>".$text['label-status']."</th>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
|
|
|
|
echo "<tr >\n";
|
|
|
|
|
echo " <td valign='top' class='".$row_style[$c]."'><a href='xml_cdr_details.php?uuid=".$uuid."'>".$direction."</a></td>\n";
|
|
|
|
|
//echo " <td valign='top' class='".$row_style[$c]."'>".$language."</td>\n";
|
|
|
|
|
//echo " <td valign='top' class='".$row_style[$c]."'>".$context."</td>\n";
|
|
|
|
|
echo " <td valign='top' class='".$row_style[$c]."'>";
|
|
|
|
|
if (file_exists($_SESSION['switch']['recordings']['dir'].'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$uuid.'.wav')) {
|
|
|
|
|
//echo " <a href=\"../recordings/v_recordings.php?a=download&type=rec&t=bin&filename=".base64_encode('archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$uuid.'.wav')."\">\n";
|
|
|
|
|
//echo " </a>";
|
|
|
|
|
|
2013-09-21 23:45:35 +02:00
|
|
|
echo " <a href=\"javascript:void(0);\" onclick=\"window.open('../recordings/v_recording_play.php?a=download&type=moh&filename=".base64_encode('archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$uuid.'.wav')."', 'play',' width=420,height=40,menubar=no,status=no,toolbar=no')\">\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
//$tmp_file_array = explode("\.",$file);
|
|
|
|
|
echo $caller_id_name.' ';
|
|
|
|
|
echo " </a>";
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo $caller_id_name.' ';
|
|
|
|
|
}
|
|
|
|
|
echo " </td>\n";
|
|
|
|
|
echo " <td valign='top' class='".$row_style[$c]."'>";
|
|
|
|
|
if (file_exists($_SESSION['switch']['recordings']['dir'].'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$uuid.'.wav')) {
|
|
|
|
|
echo " <a href=\"../recordings/v_recordings.php?a=download&type=rec&t=bin&filename=".base64_encode('archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$uuid.'.wav')."\">\n";
|
|
|
|
|
echo $caller_id_number.' ';
|
|
|
|
|
echo " </a>";
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo $caller_id_number.' ';
|
|
|
|
|
}
|
|
|
|
|
echo " </td>\n";
|
|
|
|
|
echo " <td valign='top' class='".$row_style[$c]."'>".$destination_number."</td>\n";
|
|
|
|
|
echo " <td valign='top' class='".$row_style[$c]."'>".$start_stamp."</td>\n";
|
|
|
|
|
echo " <td valign='top' class='".$row_style[$c]."'>".$end_stamp."</td>\n";
|
|
|
|
|
echo " <td valign='top' class='".$row_style[$c]."'>".$duration."</td>\n";
|
|
|
|
|
echo " <td valign='top' class='".$row_style[$c]."'>".$hangup_cause."</td>\n";
|
|
|
|
|
echo "</table>";
|
|
|
|
|
echo "<br /><br />\n";
|
|
|
|
|
|
|
|
|
|
//channel data loop
|
|
|
|
|
$c = 0;
|
|
|
|
|
$row_style["0"] = "row_style0";
|
|
|
|
|
$row_style["1"] = "row_style1";
|
|
|
|
|
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
|
|
|
|
echo "<tr>\n";
|
2012-10-24 09:35:01 +02:00
|
|
|
echo "<td align='left'><b>".$text['label-channel']."</b> </td>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "<td></td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
echo "</table>\n";
|
|
|
|
|
|
|
|
|
|
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
|
|
|
|
echo "<tr>\n";
|
2015-02-20 00:28:40 +01:00
|
|
|
echo "<th>".$text['label-name']."</th>\n";
|
|
|
|
|
echo "<th>".$text['label-value']."</th>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</tr>\n";
|
2014-06-14 10:27:21 +02:00
|
|
|
foreach($array["channel_data"] as $key => $value) {
|
2014-06-14 11:27:09 +02:00
|
|
|
$value = urldecode($value);
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "<tr >\n";
|
|
|
|
|
echo " <td valign='top' align='left' class='".$row_style[$c]."'>".$key." </td>\n";
|
|
|
|
|
echo " <td valign='top' align='left' class='".$row_style[$c]."'>".wordwrap($value,75,"<br />\n", TRUE)." </td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
if ($c==0) { $c=1; } else { $c=0; }
|
|
|
|
|
}
|
|
|
|
|
echo "</table>";
|
|
|
|
|
echo "<br /><br />\n";
|
|
|
|
|
|
|
|
|
|
//variable loop
|
|
|
|
|
$c = 0;
|
|
|
|
|
$row_style["0"] = "row_style0";
|
|
|
|
|
$row_style["1"] = "row_style1";
|
|
|
|
|
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
|
|
|
|
echo "<tr>\n";
|
2015-02-20 00:28:40 +01:00
|
|
|
echo " <td align='left'><b>".$text['label-variables']."</b> </td>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "<td></td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
echo "</table>\n";
|
|
|
|
|
|
|
|
|
|
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
|
|
|
|
echo "<tr>\n";
|
2012-10-24 09:35:01 +02:00
|
|
|
echo "<th>".$text['label-name']."</th>\n";
|
|
|
|
|
echo "<th>".$text['label-value']."</th>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</tr>\n";
|
2014-06-14 10:27:21 +02:00
|
|
|
foreach($array["variables"] as $key => $value) {
|
2014-06-14 11:27:09 +02:00
|
|
|
$value = urldecode($value);
|
2013-05-22 03:07:59 +02:00
|
|
|
if ($key != "digits_dialed" && $key != "dsn") {
|
|
|
|
|
echo "<tr >\n";
|
|
|
|
|
echo " <td valign='top' align='left' class='".$row_style[$c]."'>".$key."</td>\n";
|
|
|
|
|
if ($key == "bridge_uuid" || $key == "signal_bond") {
|
|
|
|
|
echo " <td valign='top' align='left' class='".$row_style[$c]."'>\n";
|
|
|
|
|
echo " <a href='xml_cdr_details.php?uuid=$value'>".$value."</a> \n";
|
|
|
|
|
$tmp_dir = $_SESSION['switch']['recordings']['dir'].'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day;
|
|
|
|
|
$tmp_name = '';
|
|
|
|
|
if (file_exists($tmp_dir.'/'.$value.'.wav')) {
|
|
|
|
|
$tmp_name = $value.".wav";
|
|
|
|
|
}
|
|
|
|
|
elseif (file_exists($tmp_dir.'/'.$value.'_1.wav')) {
|
|
|
|
|
$tmp_name = $value."_1.wav";
|
|
|
|
|
}
|
|
|
|
|
elseif (file_exists($tmp_dir.'/'.$value.'.mp3')) {
|
|
|
|
|
$tmp_name = $value.".mp3";
|
|
|
|
|
}
|
|
|
|
|
elseif (file_exists($tmp_dir.'/'.$value.'_1.mp3')) {
|
|
|
|
|
$tmp_name = $value."_1.mp3";
|
|
|
|
|
}
|
|
|
|
|
if (strlen($tmp_name) > 0 && file_exists($_SESSION['switch']['recordings']['dir'].'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$tmp_name)) {
|
2013-09-21 23:45:35 +02:00
|
|
|
echo " <a href=\"javascript:void(0);\" onclick=\"window.open('../recordings/v_recording_play.php?a=download&type=moh&filename=".base64_encode('archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$tmp_name)."', 'play',' width=420,height=150,menubar=no,status=no,toolbar=no')\">\n";
|
2013-05-22 03:07:59 +02:00
|
|
|
echo " play";
|
|
|
|
|
echo " </a> ";
|
|
|
|
|
}
|
|
|
|
|
if (strlen($tmp_name) > 0 && file_exists($_SESSION['switch']['recordings']['dir'].'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$tmp_name)) {
|
|
|
|
|
echo " <a href=\"../recordings/v_recordings.php?a=download&type=rec&t=bin&filename=".base64_encode("archive/".$tmp_year."/".$tmp_month."/".$tmp_day."/".$tmp_name)."\">\n";
|
|
|
|
|
echo " download";
|
|
|
|
|
echo " </a>";
|
|
|
|
|
}
|
|
|
|
|
echo "</td>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
2013-05-22 03:07:59 +02:00
|
|
|
else {
|
|
|
|
|
echo " <td valign='top' align='left' class='".$row_style[$c]."'>".wordwrap($value,75,"<br />\n", TRUE)." </td>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
2013-05-22 03:07:59 +02:00
|
|
|
echo "</tr>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
|
|
|
|
if ($c==0) { $c=1; } else { $c=0; }
|
|
|
|
|
}
|
|
|
|
|
echo "</table>";
|
|
|
|
|
echo "<br /><br />\n";
|
|
|
|
|
|
|
|
|
|
//app_log
|
|
|
|
|
$c = 0;
|
|
|
|
|
$row_style["0"] = "row_style0";
|
|
|
|
|
$row_style["1"] = "row_style1";
|
|
|
|
|
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
|
|
|
|
echo "<tr>\n";
|
2012-10-24 09:35:01 +02:00
|
|
|
echo "<td align='left'><b>".$text['label-application-log']."</b> </td>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "<td></td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
echo "</table>\n";
|
|
|
|
|
|
|
|
|
|
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
|
|
|
|
echo "<tr>\n";
|
2012-10-24 09:35:01 +02:00
|
|
|
echo "<th>".$text['label-name']."</th>\n";
|
|
|
|
|
echo "<th>".$text['label-data']."</th>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
2014-06-14 10:27:21 +02:00
|
|
|
//foreach($array["variables"] as $key => $value) {
|
2014-06-14 11:27:09 +02:00
|
|
|
foreach ($array["app_log"]["application"] as $row) {
|
2014-06-14 10:29:57 +02:00
|
|
|
$app_name = $row["@attributes"]["app_name"];
|
2014-06-14 11:27:09 +02:00
|
|
|
$app_data = urldecode($row["@attributes"]["app_data"]);
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "<tr >\n";
|
|
|
|
|
echo " <td valign='top' align='left' class='".$row_style[$c]."'>".$app_name." </td>\n";
|
|
|
|
|
echo " <td valign='top' align='left' class='".$row_style[$c]."'>".wordwrap($app_data,75,"<br />\n", TRUE)." </td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
if ($c==0) { $c=1; } else { $c=0; }
|
|
|
|
|
}
|
|
|
|
|
echo "</table>";
|
|
|
|
|
echo "<br /><br />\n";
|
|
|
|
|
|
2014-06-14 11:27:09 +02:00
|
|
|
//call flow
|
2012-06-04 16:58:40 +02:00
|
|
|
$c = 0;
|
|
|
|
|
$row_style["0"] = "row_style0";
|
|
|
|
|
$row_style["1"] = "row_style1";
|
2014-06-14 10:27:21 +02:00
|
|
|
foreach ($array["callflow"] as $row) {
|
2012-06-04 16:58:40 +02:00
|
|
|
|
|
|
|
|
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
|
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo " <td align='left'>\n";
|
|
|
|
|
|
|
|
|
|
//attributes
|
|
|
|
|
echo " <table width='95%' border='0' cellpadding='0' cellspacing='0'>\n";
|
|
|
|
|
echo " <tr>\n";
|
2012-10-24 09:35:01 +02:00
|
|
|
echo " <td><b>".$text['label-call-flow']."</b> </td>\n";
|
2015-02-20 00:28:40 +01:00
|
|
|
echo " <td> </td>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo " </tr>\n";
|
|
|
|
|
echo " </table>\n";
|
|
|
|
|
|
|
|
|
|
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
|
|
|
|
echo " <tr>\n";
|
2012-10-24 09:35:01 +02:00
|
|
|
echo " <th>".$text['label-name']."</th>\n";
|
|
|
|
|
echo " <th>".$text['label-value']."</th>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo " </tr>\n";
|
2014-06-14 10:27:21 +02:00
|
|
|
foreach($row["@attributes"] as $key => $value) {
|
2014-06-14 11:27:09 +02:00
|
|
|
$value = urldecode($value);
|
2012-06-04 16:58:40 +02:00
|
|
|
echo " <tr>\n";
|
|
|
|
|
echo " <td valign='top' align='left' class='".$row_style[$c]."'>".$key." </td>\n";
|
|
|
|
|
echo " <td valign='top' align='left' class='".$row_style[$c]."'>".wordwrap($value,75,"<br />\n", TRUE)." </td>\n";
|
|
|
|
|
echo " </tr>\n";
|
|
|
|
|
if ($c==0) { $c=1; } else { $c=0; }
|
|
|
|
|
}
|
|
|
|
|
echo " <tr>\n";
|
|
|
|
|
echo " <td colspan='2'><br /><br /></td>\n";
|
|
|
|
|
echo " </tr>\n";
|
|
|
|
|
echo "</table>\n";
|
|
|
|
|
|
2014-06-14 10:29:57 +02:00
|
|
|
//extension attributes
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
|
|
|
|
echo " <tr>\n";
|
2012-10-24 09:35:01 +02:00
|
|
|
echo " <td><b>".$text['label-call-flow-2']."</b> </td>\n";
|
2015-02-20 00:28:40 +01:00
|
|
|
echo " <td> </td>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo " </tr>\n";
|
|
|
|
|
echo "</table>\n";
|
|
|
|
|
|
|
|
|
|
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
|
|
|
|
echo " <tr>\n";
|
2012-10-24 09:35:01 +02:00
|
|
|
echo " <th>".$text['label-name']."</th>\n";
|
|
|
|
|
echo " <th>".$text['label-value']."</th>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo " </tr>\n";
|
2014-06-14 10:27:21 +02:00
|
|
|
foreach($row["extension"]["@attributes"] as $key => $value) {
|
2014-06-14 11:27:09 +02:00
|
|
|
$value = urldecode($value);
|
2012-06-04 16:58:40 +02:00
|
|
|
echo " <tr >\n";
|
|
|
|
|
echo " <td valign='top' align='left' class='".$row_style[$c]."'>".$key." </td>\n";
|
|
|
|
|
echo " <td valign='top' align='left' class='".$row_style[$c]."'>".wordwrap($value,75,"<br />\n", TRUE)." </td>\n";
|
|
|
|
|
echo " </tr>\n";
|
|
|
|
|
if ($c==0) { $c=1; } else { $c=0; }
|
|
|
|
|
}
|
|
|
|
|
echo " <tr>\n";
|
|
|
|
|
echo " <td colspan='2'><br /><br /></td>\n";
|
|
|
|
|
echo " </tr>\n";
|
|
|
|
|
echo "</table>\n";
|
|
|
|
|
|
2014-06-14 10:29:57 +02:00
|
|
|
//extension application
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
|
|
|
|
echo " <tr>\n";
|
2012-10-24 09:35:01 +02:00
|
|
|
echo " <td><b>".$text['label-call-flow-3']."</b> </td>\n";
|
2015-02-20 00:28:40 +01:00
|
|
|
echo " <td> </td>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo " </tr>\n";
|
|
|
|
|
echo "</table>\n";
|
|
|
|
|
|
|
|
|
|
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
|
|
|
|
echo " <tr>\n";
|
2012-10-24 09:35:01 +02:00
|
|
|
echo " <th>".$text['label-name']."</th>\n";
|
|
|
|
|
echo " <th>".$text['label-data']."</th>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo " </tr>\n";
|
2014-06-14 10:27:21 +02:00
|
|
|
foreach ($row["extension"]["application"] as $tmp_row) {
|
|
|
|
|
$app_name = $tmp_row["@attributes"]["app_name"];
|
2014-06-14 11:27:09 +02:00
|
|
|
$app_data = urldecode($tmp_row["@attributes"]["app_data"]);
|
2012-06-04 16:58:40 +02:00
|
|
|
echo " <tr >\n";
|
|
|
|
|
echo " <td valign='top' align='left' class='".$row_style[$c]."'>".$app_name." </td>\n";
|
|
|
|
|
echo " <td valign='top' align='left' class='".$row_style[$c]."'>".wordwrap($app_data,75,"<br />\n", TRUE)." </td>\n";
|
|
|
|
|
echo " </tr>\n";
|
|
|
|
|
if ($c==0) { $c=1; } else { $c=0; }
|
|
|
|
|
}
|
|
|
|
|
echo " <tr>\n";
|
|
|
|
|
echo " <td colspan='2'><br /><br /></td>\n";
|
|
|
|
|
echo " </tr>\n";
|
|
|
|
|
echo "</table>\n";
|
|
|
|
|
|
2014-06-14 11:27:09 +02:00
|
|
|
//caller profile
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
|
|
|
|
echo " <tr>\n";
|
2012-10-24 09:35:01 +02:00
|
|
|
echo " <td><b>".$text['label-call-flow-4']."</b> </td>\n";
|
2015-02-20 00:28:40 +01:00
|
|
|
echo " <td> </td>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo " </tr>\n";
|
|
|
|
|
echo "</table>\n";
|
|
|
|
|
|
|
|
|
|
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
|
|
|
|
echo " <tr>\n";
|
2012-10-24 09:35:01 +02:00
|
|
|
echo " <th>".$text['label-name']."</th>\n";
|
|
|
|
|
echo " <th>".$text['label-value']."</th>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo " </tr>\n";
|
2014-06-14 10:27:21 +02:00
|
|
|
foreach($row["caller_profile"] as $key => $value) {
|
2014-06-14 11:27:09 +02:00
|
|
|
$value = urldecode($value);
|
2012-06-04 16:58:40 +02:00
|
|
|
echo " <tr >\n";
|
|
|
|
|
if ($key != "originatee") {
|
2014-06-14 10:27:21 +02:00
|
|
|
$value = urldecode($value);
|
2012-06-04 16:58:40 +02:00
|
|
|
echo " <td valign='top' align='left' class='".$row_style[$c]."'>".$key." </td>\n";
|
|
|
|
|
echo " <td valign='top' align='left' class='".$row_style[$c]."'>".wordwrap($value,75,"<br />\n", TRUE)." </td>\n";
|
|
|
|
|
}
|
|
|
|
|
else {
|
2015-02-20 00:28:40 +01:00
|
|
|
echo " <td valign='top' align='left' class='".$row_style[$c]."'>".$key." </td>\n";
|
|
|
|
|
echo " <td class='".$row_style[$c]."'>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo " <table width='100%'>\n";
|
2014-06-14 10:27:21 +02:00
|
|
|
foreach($child["originatee_caller_profile"] as $key => $value) {
|
2012-06-04 16:58:40 +02:00
|
|
|
//print_r($tmp_child);
|
|
|
|
|
echo " <tr >\n";
|
|
|
|
|
echo " <td valign='top' align='left' width='20%' class='".$row_style[$c]."'>".$key." </td>\n";
|
|
|
|
|
if ($key != "uuid") {
|
|
|
|
|
echo " <td valign='top' align='left' class='".$row_style[$c]."'>".wordwrap($value,75,"<br />\n", TRUE)." </td>\n";
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo " <td valign='top' align='left' class='".$row_style[$c]."'><a href='xml_cdr_details.php?uuid=$value'>".$value."</a> </td>\n";
|
|
|
|
|
}
|
|
|
|
|
echo " </tr>\n";
|
|
|
|
|
}
|
|
|
|
|
echo " </table>\n";
|
|
|
|
|
echo " </td>\n";
|
|
|
|
|
}
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
if ($c==0) { $c=1; } else { $c=0; }
|
|
|
|
|
}
|
|
|
|
|
echo " <tr>\n";
|
|
|
|
|
echo " <td colspan='2'><br /><br /></td>\n";
|
|
|
|
|
echo " </tr>\n";
|
|
|
|
|
echo "</table>\n";
|
|
|
|
|
|
|
|
|
|
//times
|
|
|
|
|
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
|
|
|
|
echo " <tr>\n";
|
2012-10-24 09:35:01 +02:00
|
|
|
echo " <td><b>".$text['label-call-flow-5']."</b> </td>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo " <td></td>\n";
|
|
|
|
|
echo " </tr>\n";
|
|
|
|
|
|
|
|
|
|
echo " <tr>\n";
|
2012-10-24 09:35:01 +02:00
|
|
|
echo " <th>".$text['label-name']."</th>\n";
|
|
|
|
|
echo " <th>".$text['label-value']."</th>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo " </tr>\n";
|
2014-06-14 10:27:21 +02:00
|
|
|
foreach($row["times"] as $key => $value) {
|
2014-06-14 11:27:09 +02:00
|
|
|
$value = urldecode($value);
|
2012-06-04 16:58:40 +02:00
|
|
|
echo " <tr >\n";
|
|
|
|
|
echo " <td valign='top' align='left' class='".$row_style[$c]."'>".$key." </td>\n";
|
|
|
|
|
echo " <td valign='top' align='left' class='".$row_style[$c]."'>".wordwrap($value,75,"<br />\n", TRUE)." </td>\n";
|
|
|
|
|
echo " </tr>\n";
|
|
|
|
|
if ($c==0) { $c=1; } else { $c=0; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
echo " <tr>\n";
|
|
|
|
|
echo " <td colspan='2'><br /><br /></td>\n";
|
|
|
|
|
echo " </tr>\n";
|
|
|
|
|
|
|
|
|
|
echo " </table>";
|
|
|
|
|
echo " <br /><br />\n";
|
|
|
|
|
|
2014-07-27 17:52:34 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
echo "</table>";
|
|
|
|
|
}
|
2012-06-04 16:58:40 +02:00
|
|
|
|
|
|
|
|
//get the footer
|
2013-07-06 08:29:50 +02:00
|
|
|
require_once "resources/footer.php";
|
2012-06-04 16:58:40 +02:00
|
|
|
?>
|