From d704669b79dd2093daa3d3903b50baf9cc83f920 Mon Sep 17 00:00:00 2001 From: John Tolle Date: Wed, 3 Jun 2015 12:18:42 -0500 Subject: [PATCH 1/4] Update index.php Just lessening the load a bit by only updating once every 5 seconds instead of every second. --- index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.php b/index.php index bbbe446..9bc03d0 100644 --- a/index.php +++ b/index.php @@ -16,7 +16,7 @@ function() { var status = $("#status").val(); $('#status').load('status.php', {status:status}); -}, 1000); +}, 5000); + +

+
+ '; + + // regular page + echo '
'; + echo show_syslog($syslog_md5); + // syslog_md5 is used by javascript updateInfo() to determine if the syslog div contents have changed + echo ''; + //echo "log goes here


"; + echo '
'; + + echo '
'; + echo show_aststats(); + echo '
'; + + echo '
'; + echo show_sysinfo(); + echo '
'; + + + echo '
'; + + echo '
'; + echo show_sysstats(); + echo '
'; + + echo '
'; + echo show_procinfo(); + echo '
'; + + //echo '
'; + echo '
'; // #sysinfo-right, #dashboard +?> + + +
+ + '; + + if($dashboard_debug && $error->ErrorsExist()) { + $fh = fopen($amp_conf['ASTLOGDIR']."/dashboard-error.log","a"); + fwrite($fh, $error->ErrorsAsText()); + fclose($fh); + } + +} else { + // Handle AJAX updates + + switch ($info) { + case "sysstats": + echo show_sysstats(); + break; + case "aststats": + echo show_aststats(); + break; + case "procinfo": + echo show_procinfo(); + break; + case 'sysinfo': + echo show_sysinfo(); + break; + case 'syslog': + echo show_syslog($syslog_md5); + // syslog_md5 is used by javascript updateInfo() to determine if the syslog div contents have changed + echo ''; + break; + case 'syslog_ack': + do_syslog_ack(); + break; + case 'syslog_delete': + do_syslog_delete(); + break; + + case 'info': + header("Content-type: application/json"); + echo json_encode( + array( + 'procinfo'=>show_procinfo(), + 'sysinfo'=>show_sysinfo(), + 'syslog'=>show_syslog($syslog_md5), + 'syslog_md5'=>$syslog_md5, + ) + ); + break; + case 'stats': + header("Content-type: application/json"); + echo json_encode( + array( + 'sysstats'=>show_sysstats(), + 'aststats'=>show_aststats(), + ) + ); + break; + case 'all': + header("Content-type: application/json"); + echo json_encode( + array( + 'sysstats'=>show_sysstats(), + 'aststats'=>show_aststats(), + 'procinfo'=>show_procinfo(), + 'sysinfo'=>show_sysinfo(), + 'syslog'=>show_syslog(), + ) + ); + break; + } +} + +?> From 6c6239f4022c49102faa4c7a259787530c72f552 Mon Sep 17 00:00:00 2001 From: John Tolle Date: Wed, 3 Jun 2015 12:37:12 -0500 Subject: [PATCH 4/4] Update README.md --- README.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 21d82e6..19b0995 100644 --- a/README.md +++ b/README.md @@ -4,20 +4,23 @@ FeePBX Call Status Forked from http://sysadminman.net/blog/2013/asterisk-outbound-call-status-page-5600 and modified for FreePBX system running version 2.9 or higher. This is a simple HTML page that displays all active calls on a FreePBX system. This is not a FreePBX module, and does not require system credentials to view. +Note that I'm weird about dashes in directories and filenames, so I removed the original developer's dashes from call-status making it callstatus. Small detail, but it might trip you up if you weren't aware of it. + ## Requirements * FreePBX version 2.9 or later * Tested with Asterisk 1.8 and 11 ## Installation -* On a FreePBX system, download the files to the folder `[webroot]/call-status` +* On a FreePBX system, download the files to the folder `[webroot]/callstatus` * chown and chmod folder and files as necessary -* In a browser, navigate to `http:///call-status`. +* In a browser, navigate to `http:///callstatus`. +* To add to the FreePBX System Status dashboard, modify the `[webroot]/admin/modules/dashboard/page.index.php` file according to the example included here under `httproot...` As an example, to install on a Centos based distro such as PIAF or the FreePBX distro, you might use the following commands: ``` cd /var/www/html -git clone https://github.com/POSSA/freepbx-Call_Status.git call-status -chown -R asterisk:asterisk /var/www/html/call-status +git clone https://github.com/shdwlynx/freepbx-Call_Status.git callstatus +chown -R asterisk:asterisk /var/www/html/callstatus ``` ## License This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.