mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-11 20:01:35 +00:00
signalling/client.py: Rename to session-client.py
Also fix CALL -> SESSION naming
This commit is contained in:
parent
e9b0656bad
commit
c2961305e3
1 changed files with 8 additions and 6 deletions
|
@ -51,27 +51,29 @@ async def hello():
|
|||
|
||||
# Initiate call if requested
|
||||
if CALLEE_ID:
|
||||
await ws.send('CALL {}'.format(CALLEE_ID))
|
||||
await ws.send('SESSION {}'.format(CALLEE_ID))
|
||||
|
||||
# Receive messages
|
||||
sent_sdp = False
|
||||
while True:
|
||||
msg = await ws.recv()
|
||||
if msg.startswith('ERROR'):
|
||||
# On error, we bring down the webrtc pipeline, etc
|
||||
print('{!r}, exiting'.format(msg))
|
||||
return
|
||||
if sent_sdp:
|
||||
print('Got reply sdp: ' + msg)
|
||||
return # Done
|
||||
if CALLEE_ID:
|
||||
if msg == 'CALL_OK':
|
||||
if msg == 'SESSION_OK':
|
||||
await ws.send(send_sdp_ice())
|
||||
# Return so we don't have an infinite loop
|
||||
return
|
||||
sent_sdp = True
|
||||
else:
|
||||
print('Unknown reply: {!r}, exiting'.format(msg))
|
||||
return
|
||||
else:
|
||||
await ws.send(reply_sdp_ice(msg))
|
||||
# Return so we don't have an infinite loop
|
||||
return
|
||||
return # Done
|
||||
|
||||
print('Our uid is {!r}'.format(PEER_ID))
|
||||
|
Loading…
Reference in a new issue