This repository has been archived by the owner on May 10, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
103 lines (87 loc) · 2.93 KB
/
index.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<?php
require 'vendor/autoload.php';
$app = new \Slim\Slim(array(
'log.enabled' => true
));
/**
* Capabilities method
* @see https://relay.bluejeans.com/docs/mesh.html#capabilities
*/
$app->get('/:ipAddress/capabilities', function($ipAddress) use ($app) {
$app->log->info("Received capabilities request\n".print_r(array(
'ipAddress' => $ipAddress,
'port' => $app->request->get('port'),
'name' => $app->request->get('name')
), true));
$app->response->headers->set('Content-Type', 'application/json');
echo json_encode(array(
'JOIN' => true,
'HANGUP' => true,
'STATUS' => true,
'MUTE_MICROPHONE' => true));
});
/**
* Status method
* @see https://relay.bluejeans.com/docs/mesh.html#status
*/
$app->get('/:ipAddress/status', function($ipAddress) use ($app) {
$app->log->info("Received status request\n".print_r(array(
'ipAddress' => $ipAddress,
'port' => $app->request->get('port'),
'name' => $app->request->get('name')
), true));
$app->response->headers->set('Content-Type', 'application/json');
echo json_encode(array(
'callActive' => false,
'microphoneMuted' => false));
});
/**
* Join method
* @see https://relay.bluejeans.com/docs/mesh.html#join
*/
$app->post('/:ipAddress/join', function($ipAddress) use ($app) {
$app->log->info("Received join request\n".print_r(array(
'ipAddress' => $ipAddress,
'dialString' => $app->request->get('dialString'),
'meetingId' => $app->request->get('meetingId'),
'passcode' => $app->request->get('passcode'),
'bridgeAddress' => $app->request->get('bridgeAddress'),
'endpoint' => json_decode($app->request->getBody())
), true));
$app->response->setStatus(204);
});
/**
* Hangup method
* @see https://relay.bluejeans.com/docs/mesh.html#hangup
*/
$app->post('/:ipAddress/hangup', function($ipAddress) use ($app) {
$app->log->info("Received hangup request\n".print_r(array(
'ipAddress' => $ipAddress,
'endpoint' => json_decode($app->request->getBody())
), true));
$app->response->setStatus(204);
});
/**
* Mute Microphone method
* @see https://relay.bluejeans.com/docs/mesh.html#mutemicrophone
*/
$app->post('/:ipAddress/mutemicrophone', function($ipAddress) use ($app) {
$app->log->info("Received mutemicrophone request\n".print_r(array(
'ipAddress' => $ipAddress,
'endpoint' => json_decode($app->request->getBody())
), true));
$app->response->setStatus(204);
});
/**
* Unmute Microphone method
* @see https://relay.bluejeans.com/docs/mesh.html#mutemicrophone
*/
$app->post('/:ipAddress/unmutemicrophone', function($ipAddress) use ($app) {
$app->log->info("Received unmutemicrophone request\n".print_r(array(
'ipAddress' => $ipAddress,
'endpoint' => json_decode($app->request->getBody())
), true));
$app->response->setStatus(204);
});
$app->run();
?>