Created
June 2, 2019 22:21
-
-
Save isaacgr/4273d86102e21bb9fccbbbfdcf840c03 to your computer and use it in GitHub Desktop.
Script to test that my janus server is actually up and running.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
janus_ip = '192.168.2.48' | |
msg = { | |
'janus': 'create', | |
'transaction': 'test' | |
} | |
r = requests.post('http://%s/janus' % janus_ip, json=msg) | |
d = r.json() | |
print d | |
_id = d['data']['id'] | |
print 'id: %s' % (_id) | |
msg = { | |
"janus":"attach", | |
"plugin":"janus.plugin.streaming", | |
"opaquedc_ip, id":"streamingtest-XN0N0H2zN3Ic", | |
"transaction":"nWiJ5VaHrIvR", | |
} | |
r = requests.post('http://%s/janus/%d' % (janus_ip, _id,), json=msg) | |
d = r.json() | |
handle = d['data']['id'] | |
print 'handle: %s' % (handle) | |
msg = { | |
"janus": "message", | |
"body": { | |
"request": "list" | |
}, | |
"transaction": "Q7SpRB8mvbfa" | |
} | |
r = requests.post('http://%s/janus/%d/%d' % (janus_ip, _id, handle,), json=msg) | |
d = r.json() | |
print 'Mount points: %r' % d['plugindata']['data']['list'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment