1 | <?php |
||
51 | class BigBlueButton |
||
52 | { |
||
53 | private $securitySalt; |
||
54 | private $bbbServerBaseUrl; |
||
55 | private $urlBuilder; |
||
56 | |||
57 | public function __construct() |
||
58 | { |
||
59 | $this->securitySalt = getenv('BBB_SECURITY_SALT'); |
||
60 | $this->bbbServerBaseUrl = getenv('BBB_SERVER_BASE_URL'); |
||
61 | $this->urlBuilder = new UrlBuilder($this->securitySalt, $this->bbbServerBaseUrl); |
||
62 | } |
||
63 | |||
64 | /** |
||
65 | * @return ApiVersionResponse |
||
66 | * |
||
67 | * @throws \RuntimeException |
||
68 | */ |
||
69 | public function getApiVersion() |
||
75 | |||
76 | /* __________________ BBB ADMINISTRATION METHODS _________________ */ |
||
77 | /* The methods in the following section support the following categories of the BBB API: |
||
78 | -- create |
||
79 | -- getDefaultConfigXML |
||
80 | -- join |
||
81 | -- end |
||
82 | */ |
||
83 | |||
84 | /** |
||
85 | * @param CreateMeetingParameters $createMeetingParams |
||
86 | * @return string |
||
87 | */ |
||
88 | public function getCreateMeetingUrl($createMeetingParams) |
||
92 | |||
93 | /** |
||
94 | * @param CreateMeetingParameters $createMeetingParams |
||
95 | * @return CreateMeetingResponse |
||
96 | * @throws \RuntimeException |
||
97 | */ |
||
98 | public function createMeeting($createMeetingParams) |
||
104 | |||
105 | /** |
||
106 | * @return string |
||
107 | */ |
||
108 | public function getDefaultConfigXMLUrl() |
||
112 | |||
113 | /** |
||
114 | * @return GetDefaultConfigXMLResponse |
||
115 | * @throws \RuntimeException |
||
116 | */ |
||
117 | public function getDefaultConfigXML() |
||
123 | |||
124 | /** |
||
125 | * @return string |
||
126 | */ |
||
127 | public function setConfigXMLUrl() |
||
131 | |||
132 | /** |
||
133 | * @return SetConfigXMLResponse |
||
134 | * @throws \RuntimeException |
||
135 | */ |
||
136 | public function setConfigXML($setConfigXMLParams) |
||
144 | |||
145 | /** |
||
146 | * @param $joinMeetingParams JoinMeetingParameters |
||
147 | * |
||
148 | * @return string |
||
149 | */ |
||
150 | public function getJoinMeetingURL($joinMeetingParams) |
||
154 | |||
155 | /** |
||
156 | * @param $joinMeetingParams JoinMeetingParameters |
||
157 | * |
||
158 | * @return JoinMeetingResponse |
||
159 | * @throws \RuntimeException |
||
160 | */ |
||
161 | public function joinMeeting($joinMeetingParams) |
||
167 | |||
168 | /** |
||
169 | * @param $endParams EndMeetingParameters |
||
170 | * |
||
171 | * @return string |
||
172 | */ |
||
173 | public function getEndMeetingURL($endParams) |
||
177 | |||
178 | /** |
||
179 | * @param $endParams EndMeetingParameters |
||
180 | * |
||
181 | * @return EndMeetingResponse |
||
182 | * @throws \RuntimeException |
||
183 | * */ |
||
184 | public function endMeeting($endParams) |
||
190 | |||
191 | /* __________________ BBB MONITORING METHODS _________________ */ |
||
192 | /* The methods in the following section support the following categories of the BBB API: |
||
193 | -- isMeetingRunning |
||
194 | -- getMeetings |
||
195 | -- getMeetingInfo |
||
196 | */ |
||
197 | |||
198 | /** |
||
199 | * @param $meetingParams IsMeetingRunningParameters |
||
200 | * @return string |
||
201 | */ |
||
202 | public function getIsMeetingRunningUrl($meetingParams) |
||
206 | |||
207 | /** |
||
208 | * @param $meetingParams |
||
209 | * @return IsMeetingRunningResponse |
||
210 | * @throws \RuntimeException |
||
211 | */ |
||
212 | public function isMeetingRunning($meetingParams) |
||
218 | |||
219 | /** |
||
220 | * @return string |
||
221 | */ |
||
222 | public function getMeetingsUrl() |
||
226 | |||
227 | /** |
||
228 | * @return GetMeetingsResponse |
||
229 | * @throws \RuntimeException |
||
230 | */ |
||
231 | public function getMeetings() |
||
237 | |||
238 | /** |
||
239 | * @param $meetingParams GetMeetingInfoParameters |
||
240 | * @return string |
||
241 | */ |
||
242 | public function getMeetingInfoUrl($meetingParams) |
||
246 | |||
247 | /** |
||
248 | * @param $meetingParams GetMeetingInfoParameters |
||
249 | * @return GetMeetingInfoResponse |
||
250 | * @throws \RuntimeException |
||
251 | */ |
||
252 | public function getMeetingInfo($meetingParams) |
||
258 | |||
259 | /* __________________ BBB RECORDING METHODS _________________ */ |
||
260 | /* The methods in the following section support the following categories of the BBB API: |
||
261 | -- getRecordings |
||
262 | -- publishRecordings |
||
263 | -- deleteRecordings |
||
264 | */ |
||
265 | |||
266 | /** |
||
267 | * @param $recordingsParams GetRecordingsParameters |
||
268 | * @return string |
||
269 | */ |
||
270 | public function getRecordingsUrl($recordingsParams) |
||
274 | |||
275 | /** |
||
276 | * @param $recordingParams |
||
277 | * @return GetRecordingsResponse |
||
278 | * @throws \RuntimeException |
||
279 | */ |
||
280 | public function getRecordings($recordingParams) |
||
286 | |||
287 | /** |
||
288 | * @param $recordingParams PublishRecordingsParameters |
||
289 | * @return string |
||
290 | */ |
||
291 | public function getPublishRecordingsUrl($recordingParams) |
||
295 | |||
296 | /** |
||
297 | * @param $recordingParams PublishRecordingsParameters |
||
298 | * @return PublishRecordingsResponse |
||
299 | * @throws \RuntimeException |
||
300 | */ |
||
301 | public function publishRecordings($recordingParams) |
||
307 | |||
308 | /** |
||
309 | * @param $recordingParams DeleteRecordingsParameters |
||
310 | * @return string |
||
311 | */ |
||
312 | public function getDeleteRecordingsUrl($recordingParams) |
||
316 | |||
317 | /** |
||
318 | * @param $recordingParams DeleteRecordingsParameters |
||
319 | * @return DeleteRecordingsResponse |
||
320 | * @throws \RuntimeException |
||
321 | */ |
||
322 | public function deleteRecordings($recordingParams) |
||
328 | |||
329 | /** |
||
330 | * @param $recordingParams UpdateRecordingsParameters |
||
331 | * @return string |
||
332 | */ |
||
333 | public function getUpdateRecordingsUrl($recordingParams) |
||
337 | |||
338 | /** |
||
339 | * @param $recordingParams UpdateRecordingsParameters |
||
340 | * @return UpdateRecordingsResponse |
||
341 | * @throws \RuntimeException |
||
342 | */ |
||
343 | public function updateRecordings($recordingParams) |
||
349 | |||
350 | /* ____________________ INTERNAL CLASS METHODS ___________________ */ |
||
351 | |||
352 | /** |
||
353 | * A private utility method used by other public methods to process XML responses. |
||
354 | * |
||
355 | * @param string $url |
||
356 | * @param string $xml |
||
357 | * @return SimpleXMLElement |
||
358 | * @throws \RuntimeException |
||
359 | */ |
||
360 | private function processXmlResponse($url, $xml = '', $contentType = 'application/xml') |
||
404 | } |
||
405 |