-
Notifications
You must be signed in to change notification settings - Fork 6
/
media_sessions.phtml
66 lines (52 loc) · 1.81 KB
/
media_sessions.phtml
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
require '/etc/cdrtool/global.inc';
page_open(
array(
"sess" => "CDRTool_Session",
"auth" => "CDRTool_Auth",
"perm" => "CDRTool_Perm"
)
);
$perm->check("statistics");
require 'media_sessions.php';
$title = "Media sessions";
include 'header.phtml';
global $CDRTool;
$allowedDomains = array();
if (strlen($CDRTool['filter']['domain'])) {
$allowedDomains = explode(' ', $CDRTool['filter']['domain']);
}
$layout = new pageLayoutLocal();
$layout->showTopMenu($title);
if (isset($_REQUEST['datasource'])) {
$datasources = array($_REQUEST['datasource']);
} else {
$datasources = array_keys($DATASOURCES);
}
$user = isset($_REQUEST['user']) ? $_REQUEST['user'] : '';
foreach ($datasources as $datasource) {
if (in_array($datasource, $CDRTool['dataSourcesAllowed'])) {
if (array_key_exists('mediaSessions', $DATASOURCES[$datasource])) {
// MediaProxy 2 over NGNPro
printf("<h2>%s (MediaProxy 2)</h2><br />", $DATASOURCES[$datasource]['name']);
$filters = array('user' => $user);
$MediaSessions = new MediaSessionsNGNPro($DATASOURCES[$datasource]['mediaSessions'], $allowedDomains, $filters);
$MediaSessions->getSessions();
$MediaSessions->showAll();
} elseif (array_key_exists('mediaDispatcher', $DATASOURCES[$datasource])) {
// MediaProxy 2 via dispatcher tcp socket
printf("<h2>%s (MediaProxy 2.x)</h2><br />", $DATASOURCES[$datasource]['name']);
$filters = array('user' => $user);
$MediaSessions = new MediaSessions($DATASOURCES[$datasource]['mediaDispatcher'], $allowedDomains, $filters);
$MediaSessions->getSessions();
$MediaSessions->showAll();
}
}
}
$layout->showFooter();
print "
</body>
</html>
";
page_close();
?>