I'm using libjingle_peerconnection
installed with cocoapods. When I receive SDP offer through signaling server from my caller, I'm trying to set this as a remote description, which triggers RTCSessionDescriptionDelegate
peerConnection:didSetSessionDescriptionWithError:
with error:
Error Domain=RTCSDPError Code=-1 "(null)" UserInfo={error=Failed to set remote answer sdp: Called in wrong state: STATE_INIT}
.
My code is:
- (void)transportChanell:(TransportChannel *)channel didReceivedSignalWithSessionDescription:(NSString *)sessionDescription withType:(NSString *)type {
RTCSessionDescription *remoteDesc = [[RTCSessionDescription alloc] initWithType:@"answer" sdp:sessionDescription];
[_peerConnection setRemoteDescriptionWithDelegate:self sessionDescription:remoteDesc];
}
I've investigated the problem quite a lot and found in webRTC source code the place, as I suppose, this error comes from BadRemoteSdp(type, BadStateErrMsg(state()), err_desc);
and all possible states of WebRtcSession
are:
STATE_INIT = 0,
STATE_SENTOFFER, // Sent offer, waiting for answer.
STATE_RECEIVEDOFFER, // Received an offer. Need to send answer.
STATE_SENTPRANSWER, // Sent provisional answer. Need to send answer.
STATE_RECEIVEDPRANSWER, // Received provisional answer, waiting for answer.
STATE_INPROGRESS, // Offer/answer exchange completed.
STATE_CLOSED, // Close() was called.
Any suggestions, please, what could I missed in caller or callee side?
RTCSessionDescription *remoteDesc = [[RTCSessionDescription alloc] initWithType:@"answer" sdp:sessionDescription];
--
---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/5fd2b6b8-98d9-4f58-a23d-d4001b5e51fb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Thanks for help, it seems I overcame an error and continue executing next steps and new problem occured on callee side. I'm working with this tutorial https://tech.appear.in/2015/05/25/Getting-started-with-WebRTC-on-iOS/ and want to build simple version of videochat, where caller makes call and streams himself to callee. Check my picture, please:
I'm using
libjingle_peerconnection
installed with cocoapods. When I receive SDP offer through signaling server from my caller, I'm trying to set this as a remote description, which triggersRTCSessionDescriptionDelegate
peerConnection:didSetSessionDescriptionWithError:
with error: