-
Notifications
You must be signed in to change notification settings - Fork 1
/
createConference.py
45 lines (37 loc) · 1.18 KB
/
createConference.py
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
# coding=utf8
'''
@author: Andrey Zobov
Example:
1. Connect to TrueConf Server.
2. Authorize on the server.
'''
import pyVideoSDK
from pyVideoSDK.methods import Methods
from pyVideoSDK.consts import EVENT, METHOD_RESPONSE
import pyVideoSDK.consts as C
import config
print(__doc__)
TRUECONF_SERVER = "<Server IP>"
TRUECONF_ID = "<trueconf_id>"
PASSWORD = "<password>"
sdk = pyVideoSDK.open_session(ip = config.IP, port = config.PORT, pin = config.PIN, debug = config.DEBUG)
methods = Methods(sdk)
@sdk.handler(EVENT[C.EV_appStateChanged])
@sdk.handler(METHOD_RESPONSE[C.M_getAppState])
def on_state_change(response):
print(f' Application state is {response["appState"]}')
# Need to login
if response["appState"] == 2:
methods.login(TRUECONF_ID, PASSWORD)
elif response["appState"] == 3:
# Create a new conference when it's possible: appState is 3
methods.createConference("My conference title", C.CONFTYPE_symmetric, True, ["kiosk2", "kiosk3"])
'''
@sdk.handler({})
def on_all(response):
print(f' @@@ {response}')
'''
if __name__ == '__main__':
# Try to connect to TrueConf Server
methods.connectToServer(TRUECONF_SERVER)
sdk.run()