forked from krotesk/genconf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathregistrar.php
48 lines (45 loc) · 1.62 KB
/
registrar.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" >
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="height=device-height">
<title>Table phones Yealink</title>
<link href="style.css" rel="stylesheet" type="text/css">
<style type="text/css">
/* Sortable tables */
table.sortable thead {
background-color:#eee;
color:#666666;
font-weight: bold;
cursor: default;
}
</style>
</head>
<body height="100%" bgcolor="CCCCCC">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF" class="main_border">
<tr>
<td colspan="3" bgcolor="#0066ff"><img src="blocks/head011.png" width="500" height="97"></td>
</tr>
</table>
<?php
$request = shell_exec("asterisk -rx 'database show registrar'");
$request = explode("/registrar/contact/", $request);
echo "<table border='1' class='sortable'><tr><th>IP-address</th><th>Number</th><th>Useragent</th></tr>";
foreach ($request as $row) {
$row = explode(": ", $row);
$dates = explode(":", $row[1]);
echo "<tr>";
$exten = explode(",", $dates[7])[0];
$ifind = array_search('135', $exten);
if (!empty($ifind)){
var_dump($ifind);
}
echo "<td>" . explode(",", $dates[1])[0] . "</td>";
echo "<td>" . explode(",", $dates[7])[0] . "</td>";
echo "<td>" . explode(",", $dates[14])[0] . "</td>";
echo "</tr>";
}
echo "</table>";
?>
</body>
</html>