gst-examples: webrtc: signalling: simple-server Fix condition when calling a busy...
authorbyran77 <byran77@outlook.com>
Mon, 15 Nov 2021 09:04:07 +0000 (17:04 +0800)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Mon, 12 Dec 2022 15:08:23 +0000 (15:08 +0000)
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>

subprojects/gst-examples/webrtc/signalling/simple_server.py

index bbda9ae..cb42591 100755 (executable)
@@ -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')