gst-examples: webrtc: signalling: simple-server Fix condition when calling a busy peer

When a session request is coming in, ERROR occurs when the callee is busy.
But peer_status is the status of the caller, which is of course None when
calling someone, while self.peers[callee_id][2] is that of the callee.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2460>
This commit is contained in:
byran77 2021-11-15 17:04:07 +08:00 committed by GStreamer Marge Bot
parent 06c7b33505
commit 1e5abde7b1

View file

@ -161,7 +161,7 @@ class WebRTCSimpleServer(object):
if callee_id not in self.peers:
await ws.send('ERROR peer {!r} not found'.format(callee_id))
continue
if peer_status is not None:
if self.peers[callee_id][2] is not None:
await ws.send('ERROR peer {!r} busy'.format(callee_id))
continue
await ws.send('SESSION_OK')