Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to set session description on WebRTC

I set the remote description, callback didSetSessionDescriptionWithError got hit, & showing the error :

- (void)processAnswer:(NSString *)sdpAnswer connectionId:(NSString *)connectionId {
    //NSParameterAssert(sdpAnswer);
    NSParameterAssert(connectionId);

    NBMPeerConnection *connection = self.connectionMap[connectionId];
    __block __weak RTCPeerConnection* peerConnection = connection.peerConnection;
    RTCSessionDescription *description = [[RTCSessionDescription alloc] initWithType:RTCSdpTypeAnswer sdp:sdpAnswer];
   [connection.peerConnection setRemoteDescription:description completionHandler:^(NSError * _Nullable error) {
    [self peerConnection:peerConnection didSetSessionDescriptionWithError:error];
}];
}

after call getting this error.

Error Domain=org.webrtc.RTCPeerConnection Code=-1 "SessionDescription is NULL."

like image 461
Avinash Vaghasiya Avatar asked Sep 26 '16 07:09

Avinash Vaghasiya


People also ask

Why do some WebRTC connections fail?

Failed WebRTC connections can be caused by restrictive networks behind symmetric NATs, port blocks and even protocol blocks at the application & transport layers. We will delve in the intricate process of establishing a peer 2 peer WebRTC connection and lay out the mechanisms that can lead to failed connections.

What is rtcpeerconnection setremotedescription() method?

The RTCPeerConnection method setRemoteDescription () sets the specified session description as the remote peer's current offer or answer. The description specifies the properties of the remote end of the connection, including the media format.

How does WebRTC work with Kurento?

With some WebRTC use cases like video recording the endpoint (in our case Kurento) will act as both a signaling server and as an WebRTC endpoint. Each client will send the data through UDP to the other endpoint: if it’s sending directly to the other party (to a host or srflx candidate) it will send to any port in the 0-65535 range

What is the WebRTC connection test?

The WebRTC connection test is a very useful tool for checking everything from discovered ICE candidates and thus network restrictions to supported camera resolutions. We send it out to clients and analyze the text report it generates for troubles.


1 Answers

I had faced the same error and fixed it by adding "\n" to the end of the of the Offer string. Hope this helps.

like image 97
Nekruz Kasimov Avatar answered Oct 07 '22 22:10

Nekruz Kasimov