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>
|
2023-06-02 00:55:19 +02:00
|
|
|
Portions created by the Initial Developer are Copyright (C) 2008-2023
|
2012-06-04 16:58:40 +02:00
|
|
|
the Initial Developer. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
Contributor(s):
|
|
|
|
|
Mark J Crane <markjcrane@fusionpbx.com>
|
|
|
|
|
*/
|
2016-11-24 06:01:37 +01:00
|
|
|
|
2022-10-11 00:35:14 +02:00
|
|
|
//includes files
|
2023-06-15 19:28:23 +02:00
|
|
|
require_once dirname(__DIR__, 2) . "/resources/require.php";
|
2016-11-24 06:01:37 +01:00
|
|
|
require_once "resources/check_auth.php";
|
|
|
|
|
|
2018-10-18 06:36:03 +02:00
|
|
|
//check permissions
|
2020-09-23 18:25:55 +02:00
|
|
|
if (permission_exists('xml_cdr_details')) {
|
2016-11-24 06:01:37 +01:00
|
|
|
//access granted
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo "access denied";
|
|
|
|
|
exit;
|
|
|
|
|
}
|
2012-06-04 16:58:40 +02:00
|
|
|
|
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
|
2019-09-03 16:29:44 +02:00
|
|
|
if (is_uuid($_REQUEST["id"])) {
|
|
|
|
|
$uuid = $_REQUEST["id"];
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
|
|
|
|
|
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 ";
|
2018-05-19 21:24:23 +02:00
|
|
|
if (permission_exists('xml_cdr_all')) {
|
2019-09-03 16:29:44 +02:00
|
|
|
$sql .= "where xml_cdr_uuid = :xml_cdr_uuid ";
|
2015-03-06 18:15:09 +01:00
|
|
|
}
|
2019-09-03 16:29:44 +02:00
|
|
|
else {
|
|
|
|
|
$sql .= "where xml_cdr_uuid = :xml_cdr_uuid ";
|
|
|
|
|
$sql .= "and domain_uuid = :domain_uuid ";
|
|
|
|
|
$parameters['domain_uuid'] = $domain_uuid;
|
|
|
|
|
}
|
|
|
|
|
$parameters['xml_cdr_uuid'] = $uuid;
|
|
|
|
|
$database = new database;
|
|
|
|
|
$row = $database->select($sql, $parameters, 'row');
|
2023-06-02 00:55:19 +02:00
|
|
|
if (!empty($row) && is_array($row) && @sizeof($row) != 0) {
|
2023-10-13 07:58:11 +02:00
|
|
|
$caller_id_name = trim($row["caller_id_name"]);
|
|
|
|
|
$caller_id_number = trim($row["caller_id_number"]);
|
|
|
|
|
$caller_destination = trim($row["caller_destination"]);
|
|
|
|
|
$destination_number = trim($row["destination_number"]);
|
|
|
|
|
$duration = trim($row["billsec"]);
|
2023-10-15 06:15:32 +02:00
|
|
|
$missed_call = trim($row["missed_call"]);
|
2019-09-03 16:29:44 +02:00
|
|
|
$start_stamp = trim($row["start_stamp"]);
|
2023-06-02 00:55:19 +02:00
|
|
|
$xml_string = trim($row["xml"] ?? '');
|
2019-09-03 16:29:44 +02:00
|
|
|
$json_string = trim($row["json"]);
|
2023-10-18 00:21:17 +02:00
|
|
|
$call_flow = trim($row["call_flow"]);
|
2023-08-26 00:13:02 +02:00
|
|
|
$direction = trim($row["direction"]);
|
2023-10-13 07:58:11 +02:00
|
|
|
$call_direction = trim($row["direction"]);
|
2023-10-15 06:15:32 +02:00
|
|
|
$status = trim($row["status"]);
|
2019-09-03 16:29:44 +02:00
|
|
|
}
|
|
|
|
|
unset($sql, $parameters, $row);
|
2012-06-04 16:58:40 +02:00
|
|
|
|
2014-06-14 09:41:22 +02:00
|
|
|
//get the format
|
2023-05-05 18:46:37 +02:00
|
|
|
if (!empty($xml_string)) {
|
2014-06-14 09:41:22 +02:00
|
|
|
$format = "xml";
|
|
|
|
|
}
|
2023-05-05 18:46:37 +02:00
|
|
|
if (!empty($json_string)) {
|
2014-06-14 09:41:22 +02:00
|
|
|
$format = "json";
|
|
|
|
|
}
|
|
|
|
|
|
2012-06-04 16:58:40 +02:00
|
|
|
//get cdr from the file system
|
2019-04-18 19:58:34 +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);
|
2019-09-03 16:29:44 +02:00
|
|
|
if (is_null($array)) {
|
2019-04-18 19:58:34 +02:00
|
|
|
$j = stripslashes($json_string);
|
|
|
|
|
$array = json_decode($j,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
|
|
|
}
|
2019-09-03 16:29:44 +02:00
|
|
|
catch (Exception $e) {
|
2012-06-04 16:58:40 +02:00
|
|
|
echo $e->getMessage();
|
|
|
|
|
}
|
|
|
|
|
|
2023-10-13 07:58:11 +02:00
|
|
|
//get the variables
|
|
|
|
|
$xml_cdr_uuid = urldecode($array["variables"]["uuid"]);
|
|
|
|
|
$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_epoch = urldecode($array["variables"]["answer_epoch"]);
|
|
|
|
|
$answer_uepoch = urldecode($array["variables"]["answer_uepoch"]);
|
|
|
|
|
$end_epoch = urldecode($array["variables"]["end_epoch"]);
|
|
|
|
|
$end_uepoch = urldecode($array["variables"]["end_uepoch"]);
|
|
|
|
|
$end_stamp = urldecode($array["variables"]["end_stamp"]);
|
|
|
|
|
//$duration = urldecode($array["variables"]["duration"]);
|
|
|
|
|
$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"] ?? '');
|
|
|
|
|
$hangup_cause = urldecode($array["variables"]["hangup_cause"]);
|
|
|
|
|
$hangup_cause_q850 = urldecode($array["variables"]["hangup_cause_q850"]);
|
|
|
|
|
$network_address = urldecode($array["variables"]["network_address"]);
|
|
|
|
|
$outbound_caller_id_name = urldecode($array["variables"]["outbound_caller_id_name"]);
|
|
|
|
|
$outbound_caller_id_number = urldecode($array["variables"]["outbound_caller_id_number"]);
|
|
|
|
|
|
2023-10-15 06:15:32 +02:00
|
|
|
//set the time zone
|
|
|
|
|
if (isset($_SESSION['domain']['time_zone']['name'])) {
|
|
|
|
|
date_default_timezone_set($_SESSION['domain']['time_zone']['name']);
|
|
|
|
|
}
|
|
|
|
|
|
2023-10-18 00:21:17 +02:00
|
|
|
//build the call flow summary array
|
|
|
|
|
$xml_cdr = new xml_cdr;
|
2023-10-23 23:15:58 +02:00
|
|
|
$xml_cdr->domain_uuid = $_SESSION['domain_uuid'];
|
2023-10-18 00:21:17 +02:00
|
|
|
$xml_cdr->call_direction = $call_direction;
|
2023-10-19 05:28:01 +02:00
|
|
|
$xml_cdr->billsec = $billsec;
|
2023-10-18 00:21:17 +02:00
|
|
|
if (empty($call_flow)) {
|
|
|
|
|
$xml_cdr->call_details = $array;
|
|
|
|
|
$call_flow_array = $xml_cdr->call_flow();
|
2023-10-15 06:15:32 +02:00
|
|
|
}
|
2023-10-18 00:21:17 +02:00
|
|
|
else {
|
|
|
|
|
$call_flow_array = json_decode($call_flow, true);
|
2023-10-15 06:15:32 +02:00
|
|
|
}
|
2023-10-18 00:21:17 +02:00
|
|
|
$call_flow_summary = $xml_cdr->call_flow_summary($call_flow_array);
|
2023-10-15 06:15:32 +02:00
|
|
|
|
2023-10-13 12:18:47 +02:00
|
|
|
//debug information
|
|
|
|
|
if (isset($_REQUEST['debug']) && $_REQUEST['debug'] == 'true') {
|
2023-10-18 00:21:17 +02:00
|
|
|
$i = 0;
|
|
|
|
|
foreach ($call_flow_array as $row) {
|
|
|
|
|
foreach ($row["times"] as $name => $value) {
|
|
|
|
|
if ($value > 0) {
|
|
|
|
|
$call_flow_array[$i]["times"][$name.'stamp'] = date("Y-m-d H:i:s", (int) $value/1000000);
|
2023-10-15 10:20:22 +02:00
|
|
|
}
|
|
|
|
|
}
|
2023-10-18 00:21:17 +02:00
|
|
|
$i++;
|
2023-10-13 12:18:47 +02:00
|
|
|
}
|
2023-10-18 00:21:17 +02:00
|
|
|
view_array($call_flow_array, false);
|
2023-10-13 07:58:11 +02:00
|
|
|
}
|
2014-06-14 11:30:53 +02:00
|
|
|
|
2023-10-13 07:58:11 +02:00
|
|
|
//set the year, month and date
|
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));
|
|
|
|
|
|
2023-10-13 07:58:11 +02:00
|
|
|
//set the row style
|
2012-06-04 16:58:40 +02:00
|
|
|
$c = 0;
|
|
|
|
|
$row_style["0"] = "row_style0";
|
|
|
|
|
$row_style["1"] = "row_style1";
|
|
|
|
|
|
2023-10-15 06:15:32 +02:00
|
|
|
//set the status
|
2023-10-24 23:58:13 +02:00
|
|
|
if (empty($status)) {
|
|
|
|
|
//define an array of failed hangup causes
|
|
|
|
|
$failed_array = array(
|
|
|
|
|
"CALL_REJECTED",
|
|
|
|
|
"CHAN_NOT_IMPLEMENTED",
|
|
|
|
|
"DESTINATION_OUT_OF_ORDER",
|
|
|
|
|
"EXCHANGE_ROUTING_ERROR",
|
|
|
|
|
"INCOMPATIBLE_DESTINATION",
|
|
|
|
|
"INVALID_NUMBER_FORMAT",
|
|
|
|
|
"MANDATORY_IE_MISSING",
|
|
|
|
|
"NETWORK_OUT_OF_ORDER",
|
|
|
|
|
"NORMAL_TEMPORARY_FAILURE",
|
|
|
|
|
"NORMAL_UNSPECIFIED",
|
|
|
|
|
"NO_ROUTE_DESTINATION",
|
|
|
|
|
"RECOVERY_ON_TIMER_EXPIRE",
|
|
|
|
|
"REQUESTED_CHAN_UNAVAIL",
|
|
|
|
|
"SUBSCRIBER_ABSENT",
|
|
|
|
|
"SYSTEM_SHUTDOWN",
|
|
|
|
|
"UNALLOCATED_NUMBER"
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
//determine the call status
|
|
|
|
|
if ($billsec > 0) {
|
|
|
|
|
$status = 'answered';
|
|
|
|
|
}
|
2023-10-25 17:37:17 +02:00
|
|
|
if ($hangup_cause == 'NO_ANSWER') {
|
|
|
|
|
$status = 'no_answer';
|
|
|
|
|
}
|
2023-10-24 23:58:13 +02:00
|
|
|
if ($missed_call == '1') {
|
|
|
|
|
$status = 'missed';
|
|
|
|
|
}
|
|
|
|
|
if (substr($destination_number, 0, 3) == '*99') {
|
|
|
|
|
$status = 'voicemail';
|
|
|
|
|
}
|
|
|
|
|
if ($hangup_cause == 'ORIGINATOR_CANCEL') {
|
|
|
|
|
$status = 'cancelled';
|
|
|
|
|
}
|
|
|
|
|
if ($hangup_cause == 'USER_BUSY') {
|
|
|
|
|
$status = 'busy';
|
|
|
|
|
}
|
|
|
|
|
if (in_array($hangup_cause, $failed_array)) {
|
|
|
|
|
$status = 'failed';
|
|
|
|
|
}
|
2023-10-15 06:15:32 +02:00
|
|
|
}
|
|
|
|
|
|
2023-10-13 07:58:11 +02:00
|
|
|
//build the summary array
|
|
|
|
|
$summary_array = array();
|
|
|
|
|
$summary_array['direction'] = escape($direction);
|
|
|
|
|
$summary_array['caller_id_name'] = escape($caller_id_name);
|
|
|
|
|
$summary_array['caller_id_number'] = escape($caller_id_number);
|
|
|
|
|
if ($call_direction == 'outbound') {
|
|
|
|
|
$summary_array['outbound_caller_id_name'] = escape($outbound_caller_id_name);
|
|
|
|
|
$summary_array['outbound_caller_id_number'] = escape($outbound_caller_id_number);
|
|
|
|
|
}
|
|
|
|
|
$summary_array['caller_destination'] = escape($caller_destination);
|
|
|
|
|
$summary_array['destination'] = escape($destination_number);
|
|
|
|
|
$summary_array['start'] = escape($start_stamp);
|
|
|
|
|
$summary_array['end'] = escape($end_stamp);
|
|
|
|
|
$summary_array['duration'] = escape(gmdate("G:i:s", (int)$duration));
|
2023-10-15 06:15:32 +02:00
|
|
|
if (isset($status)) {
|
|
|
|
|
$summary_array['status'] = escape($status);
|
|
|
|
|
}
|
2023-10-13 07:58:11 +02:00
|
|
|
if (permission_exists('xml_cdr_hangup_cause')) {
|
|
|
|
|
$summary_array['hangup_cause'] = escape($hangup_cause);
|
|
|
|
|
}
|
2012-06-04 16:58:40 +02:00
|
|
|
|
2023-10-15 06:15:32 +02:00
|
|
|
//get the header
|
|
|
|
|
require_once "resources/header.php";
|
|
|
|
|
|
|
|
|
|
//page title and description
|
|
|
|
|
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
|
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td width='30%' align='left' valign='top' nowrap='nowrap'><b>".$text['title2']."</b></td>\n";
|
|
|
|
|
echo "<td width='70%' align='right' valign='top'>\n";
|
|
|
|
|
echo " <input type='button' class='btn' name='' alt='back' onclick=\"window.location='xml_cdr.php".(!empty($_SESSION['xml_cdr']['last_query']) ? "?".urlencode($_SESSION['xml_cdr']['last_query']) : null)."'\" value='".$text['button-back']."'>\n";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td align='left' colspan='2'>\n";
|
2023-10-15 10:20:22 +02:00
|
|
|
echo " ".$text['description-details']."\n";
|
2023-10-15 06:15:32 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
echo "</table>\n";
|
2023-10-18 00:21:17 +02:00
|
|
|
echo "<br /><br />\n";
|
2023-10-15 06:15:32 +02:00
|
|
|
|
2023-10-13 07:58:11 +02:00
|
|
|
//show the content
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
|
|
|
|
echo "<tr>\n";
|
2023-10-13 07:58:11 +02:00
|
|
|
echo " <td align='left'><b>".$text['label-summary']."</b> </td>\n";
|
|
|
|
|
echo " <td></td>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</tr>\n";
|
2023-10-13 07:58:11 +02:00
|
|
|
echo "</table>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
|
2023-10-18 00:21:17 +02:00
|
|
|
//show the call summary - vertical
|
2023-10-13 07:58:11 +02:00
|
|
|
if ($_SESSION['cdr']['summary_style']['text'] == 'vertical') {
|
|
|
|
|
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-value']."</th>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
if (is_array($summary_array)) {
|
|
|
|
|
foreach($summary_array as $name => $value) {
|
|
|
|
|
echo "<tr >\n";
|
|
|
|
|
echo " <td valign='top' align='left' class='".$row_style[$c]."'>".$text['label-'.$name]." </td>\n";
|
|
|
|
|
echo " <td valign='top' align='left' class='".$row_style[$c]."'>".$value." </td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
$c = $c ? 0 : 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
echo "</table>";
|
|
|
|
|
echo "<br /><br />\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
2023-10-13 07:58:11 +02:00
|
|
|
|
2023-10-18 00:21:17 +02:00
|
|
|
//show the call summary - horizontal
|
2023-10-13 07:58:11 +02:00
|
|
|
if ($_SESSION['cdr']['summary_style']['text'] == 'horizontal') {
|
|
|
|
|
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
|
|
|
|
echo "<th>".$text['label-direction']."</th>\n";
|
|
|
|
|
//echo "<th>Language</th>\n";
|
|
|
|
|
//echo "<th>Context</th>\n";
|
|
|
|
|
echo "<th>".$text['label-name']."</th>\n";
|
|
|
|
|
echo "<th>".$text['label-number']."</th>\n";
|
|
|
|
|
echo "<th>".$text['label-destination']."</th>\n";
|
|
|
|
|
echo "<th>".$text['label-start']."</th>\n";
|
|
|
|
|
echo "<th>".$text['label-end']."</th>\n";
|
|
|
|
|
echo "<th>".$text['label-duration']."</th>\n";
|
2023-10-15 10:20:22 +02:00
|
|
|
echo "<th align='center'>".$text['label-status']."</th>\n";
|
2023-10-25 01:06:39 +02:00
|
|
|
if (permission_exists('xml_cdr_hangup_cause')) {
|
|
|
|
|
echo "<th>".$text['label-hangup_cause']."</th>\n";
|
|
|
|
|
}
|
2023-10-13 07:58:11 +02:00
|
|
|
echo "</tr>\n";
|
|
|
|
|
echo "<tr >\n";
|
|
|
|
|
echo " <td valign='top' class='".$row_style[$c]."'><a href='xml_cdr_details.php?id=".urlencode($uuid)."'>".escape($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'].'/'.$_SESSION['domain_name'].'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$uuid.'.wav')) {
|
|
|
|
|
//echo " <a href=\"../recordings/recordings.php?a=download&type=rec&t=bin&filename=".base64_encode('archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$uuid.'.wav')."\">\n";
|
|
|
|
|
//echo " </a>";
|
2023-10-15 06:15:32 +02:00
|
|
|
|
2023-10-13 07:58:11 +02:00
|
|
|
echo " <a href=\"javascript:void(0);\" onclick=\"window.open('../recordings/recording_play.php?a=download&type=moh&filename=".urlencode('archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$uuid.'.wav')."', 'play',' width=420,height=40,menubar=no,status=no,toolbar=no')\">\n";
|
|
|
|
|
//$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'].'/'.$_SESSION['domain_name'].'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$uuid.'.wav')) {
|
|
|
|
|
echo " <a href=\"../recordings/recordings.php?a=download&type=rec&t=bin&filename=".urlencode('archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$uuid.'.wav')."\">\n";
|
|
|
|
|
echo escape($caller_id_number).' ';
|
|
|
|
|
echo " </a>";
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo escape($caller_id_number).' ';
|
|
|
|
|
}
|
|
|
|
|
echo " </td>\n";
|
|
|
|
|
echo " <td valign='top' class='".$row_style[$c]."'>".escape($destination_number)."</td>\n";
|
2023-10-15 06:15:32 +02:00
|
|
|
echo " <td valign='top' class='".$row_style[$c]."'>".escape(date("Y-m-d H:i:s", (int) $start_epoch))."</td>\n";
|
|
|
|
|
echo " <td valign='top' class='".$row_style[$c]."'>".escape(date("Y-m-d H:i:s", (int) $end_epoch))."</td>\n";
|
2023-10-13 07:58:11 +02:00
|
|
|
echo " <td valign='top' class='".$row_style[$c]."'>".escape(gmdate("G:i:s", (int)$duration))."</td>\n";
|
2023-10-21 21:25:07 +02:00
|
|
|
echo " <td valign='top' class='".$row_style[$c]."'>".escape($text['label-'.$status])."</td>\n";
|
2023-10-25 01:06:39 +02:00
|
|
|
if (permission_exists('xml_cdr_hangup_cause')) {
|
|
|
|
|
echo " <td valign='top' class='".$row_style[$c]."'>".escape($hangup_cause)."</td>\n";
|
|
|
|
|
}
|
2023-10-13 07:58:11 +02:00
|
|
|
echo "</table>";
|
|
|
|
|
echo "<br /><br />\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
|
|
|
|
|
2023-10-18 00:21:17 +02:00
|
|
|
//show the call flow summary
|
2020-09-23 18:29:13 +02:00
|
|
|
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
|
|
|
|
echo "<tr>\n";
|
2023-10-18 00:21:17 +02:00
|
|
|
echo " <td align='left'><b>".$text['label-call_flow_summary']."</b> </td>\n";
|
|
|
|
|
echo " <td></td>\n";
|
2020-09-23 18:29:13 +02:00
|
|
|
echo "</tr>\n";
|
|
|
|
|
echo "</table>\n";
|
|
|
|
|
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
|
|
|
|
echo "<tr>\n";
|
2023-10-18 00:21:17 +02:00
|
|
|
echo " <th>".$text['label-application']."</th>\n";
|
|
|
|
|
echo " <th>".$text['label-destination']."</th>\n";
|
|
|
|
|
echo " <th>".$text['label-name']."</th>\n";
|
|
|
|
|
echo " <th>".$text['label-start']."</th>\n";
|
|
|
|
|
echo " <th>".$text['label-end']."</th>\n";
|
|
|
|
|
echo " <th>".$text['label-status']."</th>\n";
|
|
|
|
|
echo " <th>".$text['label-duration']."</th>\n";
|
2020-09-23 18:29:13 +02:00
|
|
|
echo "</tr>\n";
|
2023-10-15 06:15:32 +02:00
|
|
|
$i = 1;
|
2023-10-13 07:58:11 +02:00
|
|
|
foreach ($call_flow_summary as $row) {
|
2020-09-23 18:29:13 +02:00
|
|
|
echo "<tr >\n";
|
2023-10-15 06:15:32 +02:00
|
|
|
echo " <td valign='top' class='".$row_style[$c]."'><a href=\"".$row["application_url"]."\">".escape($row["application_label"])."</a></td>\n";
|
|
|
|
|
echo " <td valign='top' class='".$row_style[$c]."'><a href=\"".$row["destination_url"]."\">".escape($row["destination_number"])."</a></td>\n";
|
|
|
|
|
echo " <td valign='top' class='".$row_style[$c]."'><a href=\"".$row["destination_url"]."\">".escape($row["destination_name"])."</a></td>\n";
|
2020-09-23 18:29:13 +02:00
|
|
|
echo " <td valign='top' class='".$row_style[$c]."'>".escape($row["start_stamp"])."</td>\n";
|
|
|
|
|
echo " <td valign='top' class='".$row_style[$c]."'>".escape($row["end_stamp"])."</td>\n";
|
2023-10-21 21:25:07 +02:00
|
|
|
echo " <td valign='top' class='".$row_style[$c]."'>".escape($text['label-'.$row["destination_status"]])."</td>\n";
|
2023-10-15 06:15:32 +02:00
|
|
|
echo " <td valign='top' class='".$row_style[$c]."'>".escape($row["duration_formatted"])."</td>\n";
|
2020-09-23 18:29:13 +02:00
|
|
|
echo "</tr>\n";
|
2023-10-13 07:58:11 +02:00
|
|
|
|
|
|
|
|
//alternate $c
|
2020-09-23 18:29:13 +02:00
|
|
|
$c = $c ? 0 : 1;
|
2023-10-15 06:15:32 +02:00
|
|
|
|
|
|
|
|
//increment the row count
|
|
|
|
|
$i++;
|
2020-09-23 18:29:13 +02:00
|
|
|
}
|
|
|
|
|
echo "</table>";
|
|
|
|
|
echo "<br /><br />\n";
|
|
|
|
|
|
2021-05-21 06:55:42 +02:00
|
|
|
//call stats
|
2023-10-25 01:06:39 +02:00
|
|
|
if (permission_exists('xml_cdr_call_stats')) {
|
|
|
|
|
$c = 0;
|
|
|
|
|
$row_style["0"] = "row_style0";
|
|
|
|
|
$row_style["1"] = "row_style1";
|
|
|
|
|
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";
|
|
|
|
|
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-value']."</th>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
foreach ($stat as $key => $value) {
|
|
|
|
|
if (!empty($value) && is_array($value)) {
|
|
|
|
|
echo "<tr >\n";
|
|
|
|
|
echo " <td valign='top' align='left' class='".$row_style[$c]."'>".escape($key)."</td>\n";
|
|
|
|
|
echo " <td valign='top' align='left' class='".$row_style[$c]."'>";
|
|
|
|
|
echo " <table border='0' cellpadding='0' cellspacing='0'>\n";
|
|
|
|
|
foreach ($value as $vk => $arrays) {
|
|
|
|
|
echo " <tr>\n";
|
|
|
|
|
echo " <td valign='top' width='15%' class='".$row_style[$c]."'>".$vk." </td>\n";
|
|
|
|
|
echo " <td valign='top'>\n";
|
|
|
|
|
echo " <table border='0' cellpadding='0' cellspacing='0'>\n";
|
|
|
|
|
foreach ($arrays as $k => $v) {
|
|
|
|
|
echo " <tr>\n";
|
|
|
|
|
echo " <td valign='top' class='".$row_style[$c]."'>".$k." </td>\n";
|
|
|
|
|
echo " <td valign='top' class='".$row_style[$c]."'>".$v."</td>\n";
|
|
|
|
|
echo " </tr>\n";
|
|
|
|
|
}
|
|
|
|
|
echo " </table>\n";
|
|
|
|
|
echo " <td>\n";
|
|
|
|
|
echo " </tr>\n";
|
|
|
|
|
}
|
|
|
|
|
echo " </table>\n";
|
|
|
|
|
echo " </td>\n";
|
|
|
|
|
echo "</tr>\n";
|
2023-07-07 23:39:38 +02:00
|
|
|
}
|
2023-10-25 01:06:39 +02:00
|
|
|
else {
|
|
|
|
|
$value = urldecode($value);
|
|
|
|
|
echo "<tr >\n";
|
|
|
|
|
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";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
}
|
|
|
|
|
$c = $c ? 0 : 1;
|
2023-07-07 23:39:38 +02:00
|
|
|
}
|
2023-10-25 01:06:39 +02:00
|
|
|
echo "</table>\n";
|
|
|
|
|
echo "<br /><br />\n";
|
2021-05-21 06:55:42 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2012-06-04 16:58:40 +02:00
|
|
|
//channel data loop
|
2023-10-25 01:06:39 +02:00
|
|
|
if (permission_exists('xml_cdr_channel_data')) {
|
|
|
|
|
$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";
|
|
|
|
|
echo "<td align='left'><b>".$text['label-channel']."</b> </td>\n";
|
|
|
|
|
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-value']."</th>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
if (is_array($array["channel_data"])) {
|
|
|
|
|
foreach($array["channel_data"] as $key => $value) {
|
|
|
|
|
if (!empty($value)) {
|
|
|
|
|
$value = urldecode($value);
|
|
|
|
|
echo "<tr >\n";
|
|
|
|
|
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";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
$c = $c ? 0 : 1;
|
|
|
|
|
}
|
2023-09-07 00:32:11 +02:00
|
|
|
}
|
|
|
|
|
}
|
2023-10-25 01:06:39 +02:00
|
|
|
echo "</table>";
|
|
|
|
|
echo "<br /><br />\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//variable loop
|
2023-10-25 01:06:39 +02:00
|
|
|
if (permission_exists('xml_cdr_variables')) {
|
|
|
|
|
$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";
|
|
|
|
|
echo " <td align='left'><b>".$text['label-variables']."</b> </td>\n";
|
|
|
|
|
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-value']."</th>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
if (is_array($array["variables"])) {
|
|
|
|
|
foreach($array["variables"] as $key => $value) {
|
|
|
|
|
if (is_array($value)) { $value = implode($value); }
|
|
|
|
|
$value = urldecode($value);
|
|
|
|
|
if ($key != "digits_dialed" && $key != "dsn") {
|
|
|
|
|
echo "<tr >\n";
|
|
|
|
|
echo " <td valign='top' align='left' class='".$row_style[$c]."'>".escape($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?id=".urlencode($value)."'>".escape($value)."</a> \n";
|
|
|
|
|
$tmp_dir = $_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day;
|
|
|
|
|
$tmp_name = '';
|
|
|
|
|
if (file_exists($tmp_dir.'/'.$value.'.wav')) {
|
|
|
|
|
$tmp_name = $value.".wav";
|
|
|
|
|
}
|
|
|
|
|
else if (file_exists($tmp_dir.'/'.$value.'_1.wav')) {
|
|
|
|
|
$tmp_name = $value."_1.wav";
|
|
|
|
|
}
|
|
|
|
|
else if (file_exists($tmp_dir.'/'.$value.'.mp3')) {
|
|
|
|
|
$tmp_name = $value.".mp3";
|
|
|
|
|
}
|
|
|
|
|
else if (file_exists($tmp_dir.'/'.$value.'_1.mp3')) {
|
|
|
|
|
$tmp_name = $value."_1.mp3";
|
|
|
|
|
}
|
|
|
|
|
if (!empty($tmp_name) && file_exists($_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$tmp_name)) {
|
|
|
|
|
echo " <a href=\"javascript:void(0);\" onclick=\"window.open('../recordings/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";
|
|
|
|
|
echo " play";
|
|
|
|
|
echo " </a> ";
|
|
|
|
|
}
|
|
|
|
|
if (!empty($tmp_name) && file_exists($_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$tmp_name)) {
|
|
|
|
|
echo " <a href=\"../recordings/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";
|
2019-09-03 16:29:44 +02:00
|
|
|
}
|
2023-10-25 01:06:39 +02:00
|
|
|
else {
|
|
|
|
|
echo " <td valign='top' align='left' class='".$row_style[$c]."'>".escape(wordwrap($value,75,"\n", true))." </td>\n";
|
2019-09-03 16:29:44 +02:00
|
|
|
}
|
2023-10-25 01:06:39 +02:00
|
|
|
echo "</tr>\n";
|
2013-05-22 03:07:59 +02:00
|
|
|
}
|
2023-10-25 01:06:39 +02:00
|
|
|
$c = $c ? 0 : 1;
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
|
|
|
|
}
|
2023-10-25 01:06:39 +02:00
|
|
|
echo "</table>";
|
|
|
|
|
echo "<br /><br />\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
|
|
|
|
|
2023-10-18 00:21:17 +02:00
|
|
|
//application log
|
2023-10-25 01:06:39 +02:00
|
|
|
if (permission_exists('xml_cdr_application_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";
|
|
|
|
|
echo "<td align='left'><b>".$text['label-application-log']."</b> </td>\n";
|
|
|
|
|
echo "<td></td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
echo "</table>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
|
2023-10-25 01:06:39 +02:00
|
|
|
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";
|
2012-06-04 16:58:40 +02:00
|
|
|
|
2023-10-25 01:06:39 +02:00
|
|
|
//foreach($array["variables"] as $key => $value) {
|
|
|
|
|
if (is_array($array["app_log"]["application"])) {
|
|
|
|
|
foreach ($array["app_log"]["application"] as $key=>$row) {
|
|
|
|
|
//single app
|
|
|
|
|
if ($key === "@attributes") {
|
|
|
|
|
$app_name = $row["app_name"];
|
|
|
|
|
$app_data = urldecode($row["app_data"]);
|
|
|
|
|
}
|
2023-10-18 00:21:17 +02:00
|
|
|
|
2023-10-25 01:06:39 +02:00
|
|
|
//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)." </td>\n";
|
|
|
|
|
echo " <td valign='top' align='left' class='".$row_style[$c]."'>".escape(wordwrap($app_data,75,"\n", true))." </td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
$c = $c ? 0 : 1;
|
2021-01-24 05:47:53 +01:00
|
|
|
}
|
2019-09-03 16:29:44 +02:00
|
|
|
}
|
2023-10-25 01:06:39 +02:00
|
|
|
echo "</table>";
|
|
|
|
|
echo "<br /><br />\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
|
|
|
|
|
2014-06-14 11:27:09 +02:00
|
|
|
//call flow
|
2023-10-25 01:06:39 +02:00
|
|
|
/*
|
2012-06-04 16:58:40 +02:00
|
|
|
$c = 0;
|
|
|
|
|
$row_style["0"] = "row_style0";
|
|
|
|
|
$row_style["1"] = "row_style1";
|
2023-10-18 00:21:17 +02:00
|
|
|
if (is_array($call_flow_array)) {
|
|
|
|
|
foreach ($call_flow_array as $row) {
|
2019-09-03 16:29:44 +02:00
|
|
|
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
|
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo " <td align='left'>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
|
2019-09-03 16:29:44 +02:00
|
|
|
//attributes
|
|
|
|
|
echo " <table width='95%' border='0' cellpadding='0' cellspacing='0'>\n";
|
|
|
|
|
echo " <tr>\n";
|
|
|
|
|
echo " <td><b>".$text['label-call-flow']."</b> </td>\n";
|
|
|
|
|
echo " <td> </td>\n";
|
|
|
|
|
echo " </tr>\n";
|
|
|
|
|
echo " </table>\n";
|
|
|
|
|
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo " <tr>\n";
|
2019-09-03 16:29:44 +02:00
|
|
|
echo " <th width='30%'>".$text['label-name']."</th>\n";
|
|
|
|
|
echo " <th width='70%'>".$text['label-value']."</th>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo " </tr>\n";
|
2019-09-03 16:29:44 +02:00
|
|
|
if (is_array($row["@attributes"])) {
|
|
|
|
|
foreach($row["@attributes"] as $key => $value) {
|
|
|
|
|
$value = urldecode($value);
|
|
|
|
|
echo " <tr>\n";
|
2019-09-03 16:44:56 +02:00
|
|
|
echo " <td valign='top' align='left' class='".$row_style[$c]."'>".escape($key)." </td>\n";
|
2019-12-28 21:37:22 +01:00
|
|
|
echo " <td valign='top' align='left' class='".$row_style[$c]."'>".escape(wordwrap($value,75,"\n", true))." </td>\n";
|
2019-09-03 16:29:44 +02:00
|
|
|
echo " </tr>\n";
|
|
|
|
|
$c = $c ? 0 : 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
echo " <tr>\n";
|
|
|
|
|
echo " <td colspan='2'><br /><br /></td>\n";
|
|
|
|
|
echo " </tr>\n";
|
|
|
|
|
echo "</table>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
|
2019-09-03 16:29:44 +02:00
|
|
|
//extension attributes
|
|
|
|
|
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
|
|
|
|
echo " <tr>\n";
|
|
|
|
|
echo " <td><b>".$text['label-call-flow-2']."</b> </td>\n";
|
|
|
|
|
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-value']."</th>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo " </tr>\n";
|
2019-09-03 16:29:44 +02:00
|
|
|
if (is_array($row["extension"]["@attributes"])) {
|
|
|
|
|
foreach($row["extension"]["@attributes"] as $key => $value) {
|
|
|
|
|
$value = urldecode($value);
|
|
|
|
|
echo " <tr >\n";
|
2019-09-03 16:44:56 +02:00
|
|
|
echo " <td valign='top' align='left' class='".$row_style[$c]."'>".escape($key)." </td>\n";
|
2019-12-28 21:37:22 +01:00
|
|
|
echo " <td valign='top' align='left' class='".$row_style[$c]."'>".escape(wordwrap($value,75,"\n", true))." </td>\n";
|
2019-09-03 16:29:44 +02:00
|
|
|
echo " </tr>\n";
|
|
|
|
|
$c = $c ? 0 : 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
echo " <tr>\n";
|
|
|
|
|
echo " <td colspan='2'><br /><br /></td>\n";
|
|
|
|
|
echo " </tr>\n";
|
|
|
|
|
echo "</table>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
|
2019-09-03 16:29:44 +02:00
|
|
|
//extension application
|
|
|
|
|
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
|
|
|
|
echo " <tr>\n";
|
|
|
|
|
echo " <td><b>".$text['label-call-flow-3']."</b> </td>\n";
|
|
|
|
|
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";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo " </tr>\n";
|
2023-07-07 23:39:38 +02:00
|
|
|
if (!empty($row["extension"]["application"]) && is_array($row["extension"]["application"])) {
|
2023-06-02 00:55:19 +02:00
|
|
|
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"] ?? '');
|
|
|
|
|
}
|
2019-09-03 16:29:44 +02:00
|
|
|
echo " <tr >\n";
|
2019-09-03 16:44:56 +02:00
|
|
|
echo " <td valign='top' align='left' class='".$row_style[$c]."'>".escape($app_name)." </td>\n";
|
2019-12-28 21:37:22 +01:00
|
|
|
echo " <td valign='top' align='left' class='".$row_style[$c]."'>".escape(wordwrap($app_data,75,"\n", true))." </td>\n";
|
2019-09-03 16:29:44 +02:00
|
|
|
echo " </tr>\n";
|
|
|
|
|
$c = $c ? 0 : 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
echo " <tr>\n";
|
|
|
|
|
echo " <td colspan='2'><br /><br /></td>\n";
|
|
|
|
|
echo " </tr>\n";
|
|
|
|
|
echo "</table>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
|
2019-09-03 16:29:44 +02:00
|
|
|
//caller profile
|
|
|
|
|
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
|
|
|
|
echo " <tr>\n";
|
|
|
|
|
echo " <td><b>".$text['label-call-flow-4']."</b> </td>\n";
|
|
|
|
|
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-value']."</th>\n";
|
|
|
|
|
echo " </tr>\n";
|
|
|
|
|
if (is_array($row["caller_profile"])) {
|
2023-06-02 00:55:19 +02:00
|
|
|
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);
|
|
|
|
|
}
|
2019-09-03 16:44:56 +02:00
|
|
|
echo " <td valign='top' align='left' class='".$row_style[$c]."'>".escape($key)." </td>\n";
|
2023-06-02 00:55:19 +02:00
|
|
|
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";
|
|
|
|
|
}
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
|
|
|
|
else {
|
2019-09-03 16:44:56 +02:00
|
|
|
echo " <td valign='top' align='left' class='".$row_style[$c]."'>".escape($key)." </td>\n";
|
2019-09-03 16:29:44 +02:00
|
|
|
echo " <td class='".$row_style[$c]."'>\n";
|
2023-06-02 00:55:19 +02:00
|
|
|
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";
|
|
|
|
|
}
|
2019-09-03 16:29:44 +02:00
|
|
|
}
|
|
|
|
|
else {
|
2023-06-02 00:55:19 +02:00
|
|
|
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";
|
2019-09-03 16:29:44 +02:00
|
|
|
}
|
|
|
|
|
}
|
2023-06-02 00:55:19 +02:00
|
|
|
unset($key_2, $value_2);
|
|
|
|
|
echo " </table>\n";
|
|
|
|
|
echo " </td>\n";
|
2019-09-03 16:29:44 +02:00
|
|
|
}
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
2019-09-03 16:29:44 +02:00
|
|
|
echo "</tr>\n";
|
|
|
|
|
$c = $c ? 0 : 1;
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
|
|
|
|
}
|
2019-09-03 16:29:44 +02:00
|
|
|
echo " <tr>\n";
|
|
|
|
|
echo " <td colspan='2'><br /><br /></td>\n";
|
|
|
|
|
echo " </tr>\n";
|
|
|
|
|
echo "</table>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
|
2019-09-03 16:29:44 +02:00
|
|
|
//times
|
|
|
|
|
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
|
|
|
|
echo " <tr>\n";
|
|
|
|
|
echo " <td><b>".$text['label-call-flow-5']."</b> </td>\n";
|
|
|
|
|
echo " <td></td>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo " </tr>\n";
|
2019-09-03 16:29:44 +02:00
|
|
|
echo " <tr>\n";
|
|
|
|
|
echo " <th width='30%'>".$text['label-name']."</th>\n";
|
|
|
|
|
echo " <th width='70%'>".$text['label-value']."</th>\n";
|
|
|
|
|
echo " </tr>\n";
|
|
|
|
|
if (is_array($row["times"])) {
|
|
|
|
|
foreach($row["times"] as $key => $value) {
|
|
|
|
|
$value = urldecode($value);
|
|
|
|
|
echo " <tr >\n";
|
2019-09-03 16:44:56 +02:00
|
|
|
echo " <td valign='top' align='left' class='".$row_style[$c]."'>".escape($key)." </td>\n";
|
2019-12-28 21:37:22 +01:00
|
|
|
echo " <td valign='top' align='left' class='".$row_style[$c]."'>".escape(wordwrap($value,75,"\n", true))." </td>\n";
|
2019-09-03 16:29:44 +02:00
|
|
|
echo " </tr>\n";
|
|
|
|
|
$c = $c ? 0 : 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
echo " </table>";
|
|
|
|
|
echo " <br /><br />\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
|
2019-09-03 16:29:44 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
echo "</table>";
|
|
|
|
|
}
|
2014-07-27 17:52:34 +02:00
|
|
|
}
|
2023-10-25 01:06:39 +02:00
|
|
|
*/
|
2012-06-04 16:58:40 +02:00
|
|
|
|
|
|
|
|
//get the footer
|
2013-07-06 08:29:50 +02:00
|
|
|
require_once "resources/footer.php";
|
2019-09-03 16:29:44 +02:00
|
|
|
|
2019-09-03 16:44:56 +02:00
|
|
|
?>
|