How to set remote peer sdp as local Description and how to change signal state stable to answer

47 views Asked by At

when i set remote peer offer in answer_sdp = RTCSessionDescription(sdp, type_value) signaling state wont change from stale to answer.

  File "/home/pi/Desktop/webrtc04.py", line 237, in <module>
    asyncio.run(main())    
  File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/home/pi/Desktop/webrtc04.py", line 217, in main
    await pc.setRemoteDescription(answer_sdp)
  File "/home/pi/.local/lib/python3.9/site-packages/aiortc/rtcpeerconnection.py", line 827, in setRemoteDescription
    self.__validate_description(description, is_local=False)
  File "/home/pi/.local/lib/python3.9/site-packages/aiortc/rtcpeerconnection.py", line 1253, in __validate_description
    raise InvalidStateError(
aiortc.exceptions.InvalidStateError: Cannot handle answer in signaling state "stable"

so, when setting remote description i got this error. await pc.setRemoteDescription(answer_sdp)

used this check but always getting stable state.

                await pc.setRemoteDescription(answer_sdp)
            else:
                print(f"Invalid signaling state: {pc.signalingState}")```



 
0

There are 0 answers