| 14 |
liveuser |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
#使用命名空間qbpwcf
|
|
|
4 |
namespace qbpwcf;
|
|
|
5 |
|
|
|
6 |
#匯入外部套件
|
|
|
7 |
include("/usr/lib/qbpwcf-devel/allInOne.php");
|
|
|
8 |
|
|
|
9 |
#end point
|
|
|
10 |
define("EndPoint","https://eu.distancelearning.cloud");
|
|
|
11 |
|
|
|
12 |
#SharedSecret
|
|
|
13 |
define("SharedSecret","gh0pXegXsmR9qVBQIcFPb2RCAfGESVirwU2zTGiK22Y");
|
|
|
14 |
|
|
|
15 |
/*
|
|
|
16 |
|
|
|
17 |
#getCheckSum test case - 1 - start
|
|
|
18 |
|
|
|
19 |
#函式說明:
|
|
|
20 |
#計算checksum
|
|
|
21 |
#回傳結果:
|
|
|
22 |
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
|
|
|
23 |
#$reuslt["error"],執行不正常結束的錯訊息陣列.
|
|
|
24 |
#$result["function"],當前執行的函式名稱.
|
|
|
25 |
#$result["content"],內容.
|
|
|
26 |
#必填參數:
|
|
|
27 |
#$conf["input"],字串,要計算checksum的內容.
|
|
|
28 |
$conf["input"]="test input string";
|
|
|
29 |
#$conf["sharedSecret"],字串,SharedSecret.
|
|
|
30 |
$conf["SharedSecret"]=SharedSecret;
|
|
|
31 |
$getCheckSum=bigbluebutton::getCheckSum($conf);
|
|
|
32 |
|
|
|
33 |
var_dump($getCheckSum);
|
|
|
34 |
|
|
|
35 |
#getCheckSum test case - 1 - end
|
|
|
36 |
|
|
|
37 |
*/
|
|
|
38 |
|
|
|
39 |
/*
|
|
|
40 |
|
|
|
41 |
#listRooms test case - 1 - start
|
|
|
42 |
|
|
|
43 |
#函式說明:
|
|
|
44 |
#取得會議室清單
|
|
|
45 |
#回傳結果:
|
|
|
46 |
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
|
|
|
47 |
#$reuslt["error"],執行不正常結束的錯訊息陣列.
|
|
|
48 |
#$result["function"],當前執行的函式名稱.
|
|
|
49 |
#$result["content"],內容.
|
|
|
50 |
#必填參數:
|
|
|
51 |
#$conf["fileArgu"],字串,變數__FILE__的內容.
|
|
|
52 |
$conf["fileArgu"]=__FILE__;
|
|
|
53 |
#$conf["bbbUrl"],字串,提供bbb服務的主機名稱.
|
|
|
54 |
$conf["bbbUrl"]=EndPoint;
|
|
|
55 |
#$conf["sharedSecret"],字串,SharedSecret.
|
|
|
56 |
$conf["SharedSecret"]=SharedSecret;
|
|
|
57 |
#可省略參數:
|
|
|
58 |
#無.
|
|
|
59 |
#備註:
|
|
|
60 |
#建構中...
|
|
|
61 |
$listRooms=bigbluebutton::listRooms($conf);
|
|
|
62 |
|
|
|
63 |
var_dump($listRooms);
|
|
|
64 |
|
|
|
65 |
#listRooms test case - 1 - end
|
|
|
66 |
|
|
|
67 |
*/
|
|
|
68 |
|
|
|
69 |
/*
|
|
|
70 |
|
|
|
71 |
#createRoom test case - 1 - start
|
|
|
72 |
|
|
|
73 |
#函式說明:
|
|
|
74 |
#建立會議室清單
|
|
|
75 |
#回傳結果:
|
|
|
76 |
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
|
|
|
77 |
#$reuslt["error"],執行不正常結束的錯訊息陣列.
|
|
|
78 |
#$result["function"],當前執行的函式名稱.
|
|
|
79 |
#$result["content"],回應的xml物件.
|
|
|
80 |
#$result["res"]["returncode"],bbb server的回應,代表API的要求狀態識別.
|
|
|
81 |
#$result["res"]["meetingID"],bbb server的回應,會議室識別碼.
|
|
|
82 |
#$result["res"]["parentMeetingID"],bbb server的回應,父會議室識別碼
|
|
|
83 |
#$result["res"]["attendeePW"],bbb server的回應,vier password.
|
|
|
84 |
#$result["res"]["moderatorPW"],bbb server的回應,admin password.
|
|
|
85 |
#$result["res"]["createTime"],bbb server的回應,unix建立時間戳記.
|
|
|
86 |
#$result["res"]["voiceBridge"],bbb server的回應,voice id.
|
|
|
87 |
#$result["res"]["dialNumber"],bbb server的回應,phone call number.
|
|
|
88 |
#$result["res"]["hasUserJoined"],bbb server的回應,是否已經有使用者了.
|
|
|
89 |
#$result["res"]["duration"],bbb server的回應,會議室的時間長度限制.
|
|
|
90 |
#$result["res"]["hasBeenForciblyEnded"],bbb server的回應,是否已經結束會議了.
|
|
|
91 |
#$result["xml"],回應的xml格式內容.
|
|
|
92 |
#必填參數:
|
|
|
93 |
#$conf["fileArgu"],字串,變數__FILE__的內容.
|
|
|
94 |
$conf["fileArgu"]=__FILE__;
|
|
|
95 |
#$conf["bbbUrl"],字串,提供bbb服務的主機名稱.
|
|
|
96 |
$conf["bbbUrl"]=EndPoint;
|
|
|
97 |
#$conf["sharedSecret"],字串,SharedSecret.
|
|
|
98 |
$conf["SharedSecret"]=SharedSecret;
|
|
|
99 |
#$conf["meetingName"],字串,會議的名稱.
|
|
|
100 |
$conf["meetingName"]="qbpwcf";
|
|
|
101 |
#$conf["moderatorPW"],字串,管理者的密碼.
|
|
|
102 |
$conf["moderatorPW"]="superfedoralinux";
|
|
|
103 |
#$conf["attendeePW"],字串,訪客的密碼.
|
|
|
104 |
$conf["attendeePW"]="000000";
|
|
|
105 |
#可省略參數:
|
|
|
106 |
#$conf["autoStartRecording"],字串,預設為"true",代表要會議一開始就錄影反之為"false".
|
|
|
107 |
#$conf["autoStartRecording"]="true".
|
|
|
108 |
#參考資料
|
|
|
109 |
#https://docs.bigbluebutton.org/dev/api.html#usage
|
|
|
110 |
#https://docs.bigbluebutton.org/dev/api.html#getmeetings
|
|
|
111 |
$createRoom=bigbluebutton::createRoom($conf);
|
|
|
112 |
unset($conf);
|
|
|
113 |
|
|
|
114 |
var_dump($createRoom);
|
|
|
115 |
|
|
|
116 |
#createRoom test case - 1 - end
|
|
|
117 |
|
|
|
118 |
*/
|
|
|
119 |
|
|
|
120 |
/*
|
|
|
121 |
|
|
|
122 |
#createRoom test case - 2 - start
|
|
|
123 |
|
|
|
124 |
#函式說明:
|
|
|
125 |
#建立會議室清單
|
|
|
126 |
#回傳結果:
|
|
|
127 |
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
|
|
|
128 |
#$reuslt["error"],執行不正常結束的錯訊息陣列.
|
|
|
129 |
#$result["function"],當前執行的函式名稱.
|
|
|
130 |
#$result["content"],回應的xml物件.
|
|
|
131 |
#$result["res"]["returncode"],bbb server的回應,代表API的要求狀態識別.
|
|
|
132 |
#$result["res"]["meetingID"],bbb server的回應,會議室識別碼.
|
|
|
133 |
#$result["res"]["parentMeetingID"],bbb server的回應,父會議室識別碼
|
|
|
134 |
#$result["res"]["attendeePW"],bbb server的回應,vier password.
|
|
|
135 |
#$result["res"]["moderatorPW"],bbb server的回應,admin password.
|
|
|
136 |
#$result["res"]["createTime"],bbb server的回應,unix建立時間戳記.
|
|
|
137 |
#$result["res"]["voiceBridge"],bbb server的回應,voice id.
|
|
|
138 |
#$result["res"]["dialNumber"],bbb server的回應,phone call number.
|
|
|
139 |
#$result["res"]["hasUserJoined"],bbb server的回應,是否已經有使用者了.
|
|
|
140 |
#$result["res"]["duration"],bbb server的回應,會議室的時間長度限制.
|
|
|
141 |
#$result["res"]["hasBeenForciblyEnded"],bbb server的回應,是否已經結束會議了.
|
|
|
142 |
#$result["xml"],回應的xml格式內容.
|
|
|
143 |
#必填參數:
|
|
|
144 |
#$conf["fileArgu"],字串,變數__FILE__的內容.
|
|
|
145 |
$conf["fileArgu"]=__FILE__;
|
|
|
146 |
#$conf["bbbUrl"],字串,提供bbb服務的主機名稱.
|
|
|
147 |
$conf["bbbUrl"]=EndPoint;
|
|
|
148 |
#$conf["sharedSecret"],字串,SharedSecret.
|
|
|
149 |
$conf["SharedSecret"]=SharedSecret;
|
|
|
150 |
#$conf["meetingName"],字串,會議的名稱.
|
|
|
151 |
$conf["meetingName"]="測試會議室";
|
|
|
152 |
#$conf["moderatorPW"],字串,管理者的密碼.
|
|
|
153 |
$conf["moderatorPW"]="superfedoralinux";
|
|
|
154 |
#$conf["attendeePW"],字串,訪客的密碼.
|
|
|
155 |
$conf["attendeePW"]="000000";
|
|
|
156 |
#可省略參數:
|
|
|
157 |
#$conf["autoStartRecording"],字串,預設為"true",代表要會議一開始就錄影反之為"false".
|
|
|
158 |
#$conf["autoStartRecording"]="true".
|
|
|
159 |
#參考資料
|
|
|
160 |
#https://docs.bigbluebutton.org/dev/api.html#usage
|
|
|
161 |
#https://docs.bigbluebutton.org/dev/api.html#getmeetings
|
|
|
162 |
$createRoom=bigbluebutton::createRoom($conf);
|
|
|
163 |
unset($conf);
|
|
|
164 |
|
|
|
165 |
var_dump($createRoom);
|
|
|
166 |
|
|
|
167 |
#createRoom test case - 2 - end
|
|
|
168 |
|
|
|
169 |
*/
|
|
|
170 |
|
|
|
171 |
/*
|
|
|
172 |
|
|
|
173 |
#enterRoom test case - 1 - start
|
|
|
174 |
|
|
|
175 |
#函式說明:
|
|
|
176 |
#加入會議室
|
|
|
177 |
#回傳結果:
|
|
|
178 |
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
|
|
|
179 |
#$reuslt["error"],執行不正常結束的錯訊息陣列.
|
|
|
180 |
#$result["function"],當前執行的函式名稱.
|
|
|
181 |
#$result["content"],回應的xml物件.
|
|
|
182 |
#$result["res"]["returncode"],bbb server的回應,代表API的要求狀態識別.
|
|
|
183 |
#$result["res"]["url"],進入會議室的網址.
|
|
|
184 |
#$result["xml"],回應的xml格式內容.
|
|
|
185 |
#必填參數:
|
|
|
186 |
#$conf["fileArgu"],字串,變數__FILE__的內容.
|
|
|
187 |
$conf["fileArgu"]=__FILE__;
|
|
|
188 |
#$conf["bbbUrl"],字串,提供bbb服務的主機名稱.
|
|
|
189 |
$conf["bbbUrl"]=EndPoint;
|
|
|
190 |
#$conf["sharedSecret"],字串,SharedSecret.
|
|
|
191 |
$conf["SharedSecret"]=SharedSecret;
|
|
|
192 |
#$conf["name"],字串,你的名字.
|
|
|
193 |
$conf["name"]="主持人";
|
|
|
194 |
#$conf["meetingID"],字串,會議室識別碼.
|
|
|
195 |
$conf["meetingID"]=$createRoom["res"]["meetingID"];
|
|
|
196 |
#$conf["password"],字串,會議室密碼.
|
|
|
197 |
$conf["password"]=$createRoom["res"]["moderatorPW"];
|
|
|
198 |
#可省略參數:
|
|
|
199 |
#無.
|
|
|
200 |
#參考資料:
|
|
|
201 |
#https://docs.bigbluebutton.org/dev/api.html#join
|
|
|
202 |
#備註:
|
|
|
203 |
#無.
|
|
|
204 |
$enterRoom=bigbluebutton::enterRoom($conf);
|
|
|
205 |
unset($conf);
|
|
|
206 |
|
|
|
207 |
var_dump($enterRoom);
|
|
|
208 |
|
|
|
209 |
#enterRoom test case - 1 - end
|
|
|
210 |
|
|
|
211 |
*/
|
|
|
212 |
|
|
|
213 |
/*
|
|
|
214 |
|
|
|
215 |
#enterRoom test case - 2 - start
|
|
|
216 |
|
|
|
217 |
#函式說明:
|
|
|
218 |
#加入會議室
|
|
|
219 |
#回傳結果:
|
|
|
220 |
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
|
|
|
221 |
#$reuslt["error"],執行不正常結束的錯訊息陣列.
|
|
|
222 |
#$result["function"],當前執行的函式名稱.
|
|
|
223 |
#$result["content"],回應的xml物件.
|
|
|
224 |
#$result["res"]["returncode"],bbb server的回應,代表API的要求狀態識別.
|
|
|
225 |
#$result["res"]["url"],進入會議室的網址.
|
|
|
226 |
#$result["xml"],回應的xml格式內容.
|
|
|
227 |
#必填參數:
|
|
|
228 |
#$conf["fileArgu"],字串,變數__FILE__的內容.
|
|
|
229 |
$conf["fileArgu"]=__FILE__;
|
|
|
230 |
#$conf["bbbUrl"],字串,提供bbb服務的主機名稱.
|
|
|
231 |
$conf["bbbUrl"]=EndPoint;
|
|
|
232 |
#$conf["sharedSecret"],字串,SharedSecret.
|
|
|
233 |
$conf["SharedSecret"]=SharedSecret;
|
|
|
234 |
#$conf["name"],字串,你的名字.
|
|
|
235 |
$conf["name"]="與會者";
|
|
|
236 |
#$conf["meetingID"],字串,會議室識別碼.
|
|
|
237 |
$conf["meetingID"]=$createRoom["res"]["meetingID"];
|
|
|
238 |
#$conf["password"],字串,會議室密碼.
|
|
|
239 |
$conf["password"]=$createRoom["res"]["attendeePW"];
|
|
|
240 |
#可省略參數:
|
|
|
241 |
#無.
|
|
|
242 |
#參考資料:
|
|
|
243 |
#https://docs.bigbluebutton.org/dev/api.html#join
|
|
|
244 |
#備註:
|
|
|
245 |
#無.
|
|
|
246 |
$enterRoom=bigbluebutton::enterRoom($conf);
|
|
|
247 |
unset($conf);
|
|
|
248 |
|
|
|
249 |
var_dump($enterRoom);
|
|
|
250 |
|
|
|
251 |
#enterRoom test case - 2 - end
|
|
|
252 |
|
|
|
253 |
*/
|
|
|
254 |
|
|
|
255 |
/*
|
|
|
256 |
|
|
|
257 |
#getRecord test case - 1 - start
|
|
|
258 |
|
|
|
259 |
#函式說明:
|
|
|
260 |
#取得會議室的錄影資料
|
|
|
261 |
#回傳結果:
|
|
|
262 |
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
|
|
|
263 |
#$reuslt["error"],執行不正常結束的錯訊息陣列.
|
|
|
264 |
#$result["function"],當前執行的函式名稱.
|
|
|
265 |
#$result["content"],回應的xml物件.
|
|
|
266 |
#$result["xml"],回應的xml格式內容.
|
|
|
267 |
#必填參數:
|
|
|
268 |
#$conf["fileArgu"],字串,變數__FILE__的內容.
|
|
|
269 |
$conf["fileArgu"]=__FILE__;
|
|
|
270 |
#$conf["bbbUrl"],字串,提供bbb服務的主機名稱.
|
|
|
271 |
$conf["bbbUrl"]=EndPoint;
|
|
|
272 |
#$conf["sharedSecret"],字串,SharedSecret.
|
|
|
273 |
$conf["SharedSecret"]=SharedSecret;
|
|
|
274 |
#可省略參數:
|
|
|
275 |
#$conf["meetingID"],字串,會議室識別碼,有的話可以找特定的會議室錄影資料.
|
|
|
276 |
#$conf["meetingID"]="";
|
|
|
277 |
#$conf["recordID"],字串,有的話可以指定要找的特定一個錄影.
|
|
|
278 |
#$conf["recordID"]="";
|
|
|
279 |
#參考資料:
|
|
|
280 |
#https://docs.bigbluebutton.org/dev/api.html#getrecordings
|
|
|
281 |
#備註:
|
|
|
282 |
#無.
|
|
|
283 |
$getRecord=bigbluebutton::getRecord($conf);
|
|
|
284 |
unset($conf);
|
|
|
285 |
|
|
|
286 |
var_dump($getRecord);
|
|
|
287 |
|
|
|
288 |
#getRecord test case - 1 - end
|
|
|
289 |
|
|
|
290 |
*/
|
|
|
291 |
|
|
|
292 |
/*
|
|
|
293 |
|
|
|
294 |
#getRecord test case - 2 - start
|
|
|
295 |
|
|
|
296 |
#函式說明:
|
|
|
297 |
#取得會議室的錄影資料
|
|
|
298 |
#回傳結果:
|
|
|
299 |
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
|
|
|
300 |
#$reuslt["error"],執行不正常結束的錯訊息陣列.
|
|
|
301 |
#$result["function"],當前執行的函式名稱.
|
|
|
302 |
#$result["content"],回應的xml物件.
|
|
|
303 |
#$result["xml"],回應的xml格式內容.
|
|
|
304 |
#必填參數:
|
|
|
305 |
#$conf["fileArgu"],字串,變數__FILE__的內容.
|
|
|
306 |
$conf["fileArgu"]=__FILE__;
|
|
|
307 |
#$conf["bbbUrl"],字串,提供bbb服務的主機名稱.
|
|
|
308 |
$conf["bbbUrl"]=EndPoint;
|
|
|
309 |
#$conf["sharedSecret"],字串,SharedSecret.
|
|
|
310 |
$conf["SharedSecret"]=SharedSecret;
|
|
|
311 |
#可省略參數:
|
|
|
312 |
#$conf["meetingID"],字串,會議室識別碼,有的話可以找特定的會議室錄影資料.
|
|
|
313 |
$conf["meetingID"]="e6969fe2-450e-11ec-8cbc-525411123501";
|
|
|
314 |
#$conf["recordID"],字串,有的話可以指定要找的特定一個錄影.
|
|
|
315 |
#$conf["recordID"]="";
|
|
|
316 |
#參考資料:
|
|
|
317 |
#https://docs.bigbluebutton.org/dev/api.html#getrecordings
|
|
|
318 |
#備註:
|
|
|
319 |
#無.
|
|
|
320 |
$getRecord=bigbluebutton::getRecord($conf);
|
|
|
321 |
unset($conf);
|
|
|
322 |
|
|
|
323 |
var_dump($getRecord);
|
|
|
324 |
|
|
|
325 |
#getRecord test case - 2 - end
|
|
|
326 |
|
|
|
327 |
*/
|
|
|
328 |
|
|
|
329 |
?>
|