diff options
Diffstat (limited to 'config/siproxd')
-rw-r--r-- | config/siproxd/siproxd_registered_phones.php | 172 |
1 files changed, 85 insertions, 87 deletions
diff --git a/config/siproxd/siproxd_registered_phones.php b/config/siproxd/siproxd_registered_phones.php index a8789d7f..51eb474a 100644 --- a/config/siproxd/siproxd_registered_phones.php +++ b/config/siproxd/siproxd_registered_phones.php @@ -1,7 +1,9 @@ <?php /* siproxd_registered_phones.php + part of pfSense (https://www.pfSense.org/) Copyright (C) 2010 Jim Pingle + Copyright (C) 2015 ESF, LLC All rights reserved. Redistribution and use in source and binary forms, with or without @@ -36,8 +38,7 @@ ##|*MATCH=siproxd_registered_phones.php* ##|-PRIV -require("guiconfig.inc"); -$pgtitle = array(gettext("Status"), gettext("siproxd Registered Phones")); +require_once("guiconfig.inc"); $phonetext = file_get_contents("/var/siproxd/siproxd_registrations"); $phonedata = explode("\n", $phonetext); @@ -47,27 +48,28 @@ if (!is_array($phonedata)) { } $activephones = array(); -for ($i=0; $i < count($phonedata); $i++) { +for ($i = 0; $i < count($phonedata); $i++) { list($stars, $active, $expires) = explode(":", $phonedata[$i]); if ($active == "1") { $phone = array(); $phone["expires"] = $expires; - $phone["real"]["type"] = $phonedata[++$i]; - $phone["real"]["user"] = $phonedata[++$i]; - $phone["real"]["host"] = $phonedata[++$i]; - $phone["real"]["port"] = $phonedata[++$i]; - $phone["nat"]["type"] = $phonedata[++$i]; - $phone["nat"]["user"] = $phonedata[++$i]; - $phone["nat"]["host"] = $phonedata[++$i]; - $phone["nat"]["port"] = $phonedata[++$i]; - $phone["registered"]["type"] = $phonedata[++$i]; - $phone["registered"]["user"] = $phonedata[++$i]; - $phone["registered"]["host"] = $phonedata[++$i]; - $phone["registered"]["port"] = $phonedata[++$i]; + $phone["real"]["type"] = $phonedata[++$i]; + $phone["real"]["user"] = $phonedata[++$i]; + $phone["real"]["host"] = $phonedata[++$i]; + $phone["real"]["port"] = $phonedata[++$i]; + $phone["nat"]["type"] = $phonedata[++$i]; + $phone["nat"]["user"] = $phonedata[++$i]; + $phone["nat"]["host"] = $phonedata[++$i]; + $phone["nat"]["port"] = $phonedata[++$i]; + $phone["registered"]["type"] = $phonedata[++$i]; + $phone["registered"]["user"] = $phonedata[++$i]; + $phone["registered"]["host"] = $phonedata[++$i]; + $phone["registered"]["port"] = $phonedata[++$i]; $activephones[] = $phone; } } +$pgtitle = array(gettext("Status"), gettext("siproxd Registered Phones")); require("head.inc"); ?> @@ -77,8 +79,7 @@ require("head.inc"); <br /> <table width="100%" border="0" cellpadding="0" cellspacing="0"> - <tr> - <td> +<tr><td> <?php $tab_array = array(); $tab_array[] = array(gettext("Settings"), false, "pkg_edit.php?xml=siproxd.xml&id=0"); @@ -86,76 +87,73 @@ require("head.inc"); $tab_array[] = array(gettext("Registered Phones"), true, "siproxd_registered_phones.php"); display_top_tabs($tab_array); ?> - </td> - </tr> - - <tr> - <td> - <div id="mainarea"> - <table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="0"> - <thead> - <tr> - <td colspan="16" class="listtopic"><?php echo gettext("Currently Registered Phones") . " (" . count($activephones) . ")"; ?></td> - </tr> - <tr> - <th colspan="5">Real Phone</th> - <th colspan="5">NAT Address</th> - <th colspan="4">Registered With</th> - <th colspan="2"> </th> - </tr> - <tr> - <th>Type</th> - <th>User</th> - <th>Host</th> - <th>Port</th> - <th> </th> - <th>Type</th> - <th>User</th> - <th>Host</th> - <th>Port</th> - <th> </th> - <th>Type</th> - <th>User</th> - <th>Host</th> - <th>Port</th> - <th> </th> - <th>Expires</th> - </tr> - </thead> - <?php if (count($phonedata) == 0): ?> - <tr><td colspan="16" align="center">No Phone Data Found</td></tr> - <? elseif (count($activephones) == 0): ?> - <tr><td colspan="16" align="center">No Active Phones</td></tr> - <? else: ?> - <? foreach ($activephones as $phone): ?> - <tr> - <td align="center" class="listlr"><? echo ($phone['real']['type']) ? $phone['real']['type'] : "sip"; ?></td> - <td align="center" class="listr"><? echo ($phone['real']['user']) ? $phone['real']['user'] : " "; ?></td> - <td align="center" class="listr"><? echo ($phone['real']['host']) ? $phone['real']['host'] : " "; ?></td> - <td align="center" class="listr"><? echo ($phone['real']['port']) ? $phone['real']['port'] : "5060"; ?></td> - - <td align="center" class="list"> </td> - <td align="center" class="listlr"><? echo ($phone['nat']['type']) ? $phone['nat']['type'] : "sip"; ?></td> - <td align="center" class="listr"><? echo ($phone['nat']['user']) ? $phone['nat']['user'] : " "; ?></td> - <td align="center" class="listr"><? echo ($phone['nat']['host']) ? $phone['nat']['host'] : " "; ?></td> - <td align="center" class="listr"><? echo ($phone['nat']['port']) ? $phone['nat']['port'] : "5060"; ?></td> - - <td align="center" class="list"> </td> - <td align="center" class="listlr"><? echo ($phone['registered']['type']) ? $phone['registered']['type'] : "sip"; ?></td> - <td align="center" class="listr"><? echo ($phone['registered']['user']) ? $phone['registered']['user'] : " "; ?></td> - <td align="center" class="listr"><? echo ($phone['registered']['host']) ? $phone['registered']['host'] : " "; ?></td> - <td align="center" class="listr"><? echo ($phone['registered']['port']) ? $phone['registered']['port'] : "5060"; ?></td> - - <td align="center" class="list"> </td> - <td align="center" class="listlr"><? echo date("m/d/Y h:i:sa", $phone['expires']); ?></td> - </tr> - <? endforeach; ?> - <? endif; ?> - </table> - </div> - </td> - </tr> - +</td></tr> + +<tr><td> + <div id="mainarea"> + <table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="0"> + <thead> + <tr> + <td colspan="16" class="listtopic"><?php echo gettext("Currently Registered Phones") . " (" . count($activephones) . ")"; ?></td> + </tr> + <tr> + <th colspan="5">Real Phone</th> + <th colspan="5">NAT Address</th> + <th colspan="4">Registered With</th> + <th colspan="2"> </th> + </tr> + <tr> + <th>Type</th> + <th>User</th> + <th>Host</th> + <th>Port</th> + <th> </th> + <th>Type</th> + <th>User</th> + <th>Host</th> + <th>Port</th> + <th> </th> + <th>Type</th> + <th>User</th> + <th>Host</th> + <th>Port</th> + <th> </th> + <th>Expires</th> + </tr> + </thead> + + <?php if (count($phonedata) == 0): ?> + <tr><td colspan="16" align="center">No Phone Data Found</td></tr> + <? elseif (count($activephones) == 0): ?> + <tr><td colspan="16" align="center">No Active Phones</td></tr> + <? else: ?> + <? foreach ($activephones as $phone): ?> + <tr> + <td align="center" class="listlr"><? echo ($phone['real']['type']) ? $phone['real']['type'] : "sip"; ?></td> + <td align="center" class="listr"><? echo ($phone['real']['user']) ? $phone['real']['user'] : " "; ?></td> + <td align="center" class="listr"><? echo ($phone['real']['host']) ? $phone['real']['host'] : " "; ?></td> + <td align="center" class="listr"><? echo ($phone['real']['port']) ? $phone['real']['port'] : "5060"; ?></td> + + <td align="center" class="list"> </td> + <td align="center" class="listlr"><? echo ($phone['nat']['type']) ? $phone['nat']['type'] : "sip"; ?></td> + <td align="center" class="listr"><? echo ($phone['nat']['user']) ? $phone['nat']['user'] : " "; ?></td> + <td align="center" class="listr"><? echo ($phone['nat']['host']) ? $phone['nat']['host'] : " "; ?></td> + <td align="center" class="listr"><? echo ($phone['nat']['port']) ? $phone['nat']['port'] : "5060"; ?></td> + + <td align="center" class="list"> </td> + <td align="center" class="listlr"><? echo ($phone['registered']['type']) ? $phone['registered']['type'] : "sip"; ?></td> + <td align="center" class="listr"><? echo ($phone['registered']['user']) ? $phone['registered']['user'] : " "; ?></td> + <td align="center" class="listr"><? echo ($phone['registered']['host']) ? $phone['registered']['host'] : " "; ?></td> + <td align="center" class="listr"><? echo ($phone['registered']['port']) ? $phone['registered']['port'] : "5060"; ?></td> + + <td align="center" class="list"> </td> + <td align="center" class="listlr"><? echo date("m/d/Y h:i:sa", $phone['expires']); ?></td> + </tr> + <? endforeach; ?> + <? endif; ?> + </table> + </div> +</td></tr> </table> <?php include("fend.inc"); ?> |