aboutsummaryrefslogtreecommitdiffstats
path: root/config/asterisk/asterisk_calls.php
diff options
context:
space:
mode:
authornagyrobi <robreg@zsurob.hu>2013-09-19 14:46:45 +0200
committernagyrobi <robreg@zsurob.hu>2013-09-19 14:46:45 +0200
commit06a8a9bd233185a4429d07f209b4bf83d2c1401e (patch)
treea0e22746f991b791e975127f8c4ef7805d348f53 /config/asterisk/asterisk_calls.php
parentce8968f62635b78519dda77241e2656d70689120 (diff)
downloadpfsense-packages-06a8a9bd233185a4429d07f209b4bf83d2c1401e.tar.gz
pfsense-packages-06a8a9bd233185a4429d07f209b4bf83d2c1401e.tar.bz2
pfsense-packages-06a8a9bd233185a4429d07f209b4bf83d2c1401e.zip
Update asterisk_calls.php
Added utf8_decode to the cells of the From column of the table, as Asterisk saves these names in UTF-8 encoding.
Diffstat (limited to 'config/asterisk/asterisk_calls.php')
-rw-r--r--config/asterisk/asterisk_calls.php43
1 files changed, 23 insertions, 20 deletions
diff --git a/config/asterisk/asterisk_calls.php b/config/asterisk/asterisk_calls.php
index 77131d8d..7fd75274 100644
--- a/config/asterisk/asterisk_calls.php
+++ b/config/asterisk/asterisk_calls.php
@@ -4,12 +4,11 @@
status_asterisk_calls.php
part of pfSense
Copyright (C) 2009 Scott Ullrich <sullrich@gmail.com>.
- Copyright (C) 2012 robreg@zsurob.hu
+ Copyright (C) 2013 robi <robreg@zsurob.hu>
All rights reserved.
originally part of m0n0wall (http://m0n0.ch/wall)
Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
- Copyright (C) 2012 robreg@zsurob.hu
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -41,7 +40,7 @@
##|*IDENT=page-status-asterisk
##|*NAME=Status: Asterisk Calls page
##|*DESCR=Allow access to the 'Status: Asterisk Calls' page.
-##|*MATCH=status_asterisk_calls.php*
+##|*MATCH=asterisk_calls.php*
##|-PRIV
require_once("guiconfig.inc");
@@ -54,7 +53,6 @@ $callog = "/var/log/asterisk/cdr-csv/Master.csv";
/* Data input processing */
$cmd = $_GET['cmd'];
-//$cmd = str_replace("+", " ", $cmd);
$file = $_SERVER["SCRIPT_NAME"];
$break = Explode('/', $file);
@@ -73,7 +71,7 @@ if (file_exists($callog))
case "download":
// session_cache_limiter('none'); //*Use before session_start()
// session_start();
-
+
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.basename($callog));
@@ -110,23 +108,21 @@ if (file_exists($callog))
<td>
<div id="mainarea">
<?php
- //$trimres=shell_exec("tail -50 '$callog' > /tmp/trimmed.csv; rm '$callog'; mv /tmp/trimmed.csv '$callog'");
- //print $trimres . "Last 50 calls: <br>";
if (file_exists($callog))
$file_handle = fopen($callog, "r");
?>
- <table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0">
- <tr>
- <td colspan="6" class="listtopic">Last 50 Asterisk calls</td>
- </tr>
- <tr>
- <td nowrap class="listhdrr"><?=gettext("From");?></td>
- <td nowrap class="listhdrr"><?=gettext("To");?></a></td>
- <td nowrap class="listhdrr"><?=gettext("Start");?></td>
- <td nowrap class="listhdrr"><?=gettext("End");?></a></td>
- <td nowrap class="listhdrr"><?=gettext("Duration");?></a></td>
- <td nowrap class="listhdrr"><?=gettext("Status");?></td>
- </tr>
+ <table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0">
+ <tr>
+ <td colspan="6" class="listtopic">Last 50 Asterisk calls</td>
+ </tr>
+ <tr>
+ <td nowrap class="listhdrr"><?=gettext("From");?></td>
+ <td nowrap class="listhdrr"><?=gettext("To");?></a></td>
+ <td nowrap class="listhdrr"><?=gettext("Start");?></td>
+ <td nowrap class="listhdrr"><?=gettext("End");?></a></td>
+ <td nowrap class="listhdrr"><?=gettext("Duration");?></a></td>
+ <td nowrap class="listhdrr"><?=gettext("Status");?></td>
+ </tr>
<?php
$out = '';
if (file_exists($callog)){
@@ -134,7 +130,7 @@ if (file_exists($callog))
$lin = fgetcsv($file_handle, 102400);
if ($lin[12] != "") {
$out = "<tr>" . $out;
- $out = "<td class='listlr'>" . str_replace('"', '', $lin[4]) . "</td><td class='listlr'>" . $lin[2] . "</td><td class='listlr'>" . $lin[9] . "</td><td class='listlr'>" . $lin[11] . "</td><td class='listlr'>" . gmdate("G:i:s", $lin[12]) . "</td><td class='listlr'>" . $lin[14] . "</td>" . $out;
+ $out = "<td class='listlr'>" . utf8_decode(str_replace('"', '', $lin[4])) . "</td><td class='listlr'>" . $lin[2] . "</td><td class='listlr'>" . $lin[9] . "</td><td class='listlr'>" . $lin[11] . "</td><td class='listlr'>" . gmdate("G:i:s", $lin[12]) . "</td><td class='listlr'>" . $lin[14] . "</td>" . $out;
$out = "</tr>" . $out;
}
}
@@ -160,6 +156,13 @@ if (file_exists($callog))
<?=gettext("Listed in reverse order (latest on top).");?> <br>
<?=gettext("Duration includes ringing time.");?> <br>
<?=gettext("Trim keeps the last 50 entries.");?>
+
+<?
+if ($g['platform'] == "nanobsd")
+ echo "<br>This log is lost when rebooting the system.";
+?>
+
+
</span>