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."
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.
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.
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
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.
I had faced the same error and fixed it by adding "\n" to the end of the of the Offer string. Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With