From: <abe...@us...> - 2014-09-04 17:59:24
|
Revision: 6693 http://sourceforge.net/p/astlinux/code/6693 Author: abelbeck Date: 2014-09-04 17:59:16 +0000 (Thu, 04 Sep 2014) Log Message: ----------- web interface, Status tab, added 'Kamailio SIP Server Status', and can be hidden via the Prefs tab Modified Paths: -------------- branches/1.0/package/webinterface/altweb/admin/prefs.php branches/1.0/package/webinterface/altweb/common/status.inc Modified: branches/1.0/package/webinterface/altweb/admin/prefs.php =================================================================== --- branches/1.0/package/webinterface/altweb/admin/prefs.php 2014-09-04 16:55:37 UTC (rev 6692) +++ branches/1.0/package/webinterface/altweb/admin/prefs.php 2014-09-04 17:59:16 UTC (rev 6693) @@ -17,6 +17,7 @@ // 09-28-2012, Added Show Custom Asterisk Command // 01-20-2013, Added Show XMPP Server Status // 09-06-2013, Added Edit Tab Shortcut support +// 09-04-2014, Added Show Kamailio SIP Server Status // $myself = $_SERVER['PHP_SELF']; @@ -113,6 +114,10 @@ $value = 'status_custom_asterisk_cmdstr = "'.$value.'"'; fwrite($fp, $value."\n"); } + if (! isset($_POST['kamailio_server'])) { + $value = 'status_show_kamailio_server = no'; + fwrite($fp, $value."\n"); + } if (! isset($_POST['xmpp_server'])) { $value = 'status_show_xmpp_server = no'; fwrite($fp, $value."\n"); @@ -627,6 +632,10 @@ putHtml('<input type="text" size="28" maxlength="64" value="'.$value.'" name="asterisk_cmd" /></td></tr>'); putHtml('<tr class="dtrow1"><td style="text-align: right;">'); + $sel = (getPREFdef($global_prefs, 'status_show_kamailio_server') !== 'no') ? ' checked="checked"' : ''; + putHtml('<input type="checkbox" value="kamailio_server" name="kamailio_server"'.$sel.' /></td><td colspan="5">Show Kamailio SIP Server Status</td></tr>'); + + putHtml('<tr class="dtrow1"><td style="text-align: right;">'); $sel = (getPREFdef($global_prefs, 'status_show_xmpp_server') !== 'no') ? ' checked="checked"' : ''; putHtml('<input type="checkbox" value="xmpp_server" name="xmpp_server"'.$sel.' /></td><td colspan="5">Show XMPP Server Status</td></tr>'); Modified: branches/1.0/package/webinterface/altweb/common/status.inc =================================================================== --- branches/1.0/package/webinterface/altweb/common/status.inc 2014-09-04 16:55:37 UTC (rev 6692) +++ branches/1.0/package/webinterface/altweb/common/status.inc 2014-09-04 17:59:16 UTC (rev 6693) @@ -32,6 +32,7 @@ // 01-20-2013, Added XMPP Server Status // 01-03-2014, Added NUT UPS Monitoring Status // 07-02-2014, Added "Show PPPoE Logs" button +// 09-04-2014, Added Kamailio SIP Server Status // // System location of OpenVPN Client logfile $OVPNCLOGFILE = '/var/log/openvpnclient-status.log'; @@ -79,6 +80,7 @@ $status['syslogd'] = 0; $status['zabbix_agentd'] = 0; $status['zabbix_proxy'] = 0; + $status['kamailio'] = 0; $status['reboot'] = 0; $output = array(); @@ -1044,6 +1046,27 @@ } } +if ($daemon['kamailio'] > 0) { + if (getPREFdef($global_prefs, 'status_show_kamailio_server') !== 'no') { + putHtml("<h2>Kamailio SIP Server Status:</h2>"); + putHtml("<pre>"); + + $output = array(); + @exec('kamcmd core.version; kamcmd tm.stats', $output); + foreach ($output as $line) { + $line = trim($line); + if ($line === '{') { + $line = '=============================='; + } elseif ($line === '}') { + continue; + } + putText($line); + } + unset($output); + putHtml("</pre>"); + } +} + if (is_file('/var/run/prosody/prosody.pid')) { if (getPREFdef($global_prefs, 'status_show_xmpp_server') !== 'no') { putHtml("<h2>XMPP Server Status:</h2>"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |