diff options
author | Marcello Coutinho <marcellocoutinho@gmail.com> | 2013-09-19 06:23:16 -0700 |
---|---|---|
committer | Marcello Coutinho <marcellocoutinho@gmail.com> | 2013-09-19 06:23:16 -0700 |
commit | 9620ec8fab91bb8484b46106c8dc780a3164c3c1 (patch) | |
tree | 9bca1b11885a2413f790a94fbbba8e9d9b187b30 /config | |
parent | b55cc4332d05086bf156afefa78325438b7d6ea2 (diff) | |
parent | 06a8a9bd233185a4429d07f209b4bf83d2c1401e (diff) | |
download | pfsense-packages-9620ec8fab91bb8484b46106c8dc780a3164c3c1.tar.gz pfsense-packages-9620ec8fab91bb8484b46106c8dc780a3164c3c1.tar.bz2 pfsense-packages-9620ec8fab91bb8484b46106c8dc780a3164c3c1.zip |
Merge pull request #491 from nagyrobi/patch-2
Update asterisk_calls.php
Diffstat (limited to 'config')
-rw-r--r-- | config/asterisk/asterisk_calls.php | 43 |
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> |