Hi
I have received answer sdp by negotiating offer sdp from peer in different process, Now I Pass answer sdp and offer sdp to separate process and invoke below flow.
var offer_ssdp_string = 'actual offer string'
var answer_sdp_string = 'actual answer string'
peerConnection = new RTCPeerConnection(servers);
peerConnection.setLocalDescription(new RTCSessionDescription({ "type": "offer", "sdp": offer_sdp }))
peerConnection.setRemoteDescription(new RTCSessionDescription({ "type": "answer", "sdp": answer_sdp }))
I am getting below errors
(Uncaught (in promise) DOMException: The SDP does not match the previously generated SDP for this type)
Failed to create session description: InvalidStateError: Failed to execute 'setRemoteDescription' on 'RTCPeerConnection': Failed to set remote answer sdp: Called in wrong state: kStable.
When I recreate offer in another process and then set answer sdp I get error as "Failed to create session description: InvalidAccessError: Failed to execute 'setRemoteDescription' on 'RTCPeerConnection': Failed to set remote answer sdp: The order of m-lines in answer doesn't match order in offer. Rejecting answer.."
peerConnection.createOffer(function(offer) {
peerConnection.setLocalDescription(offer);
peerConnection.setRemoteDescription({ "type": "answer", "sdp": answer_sdp })
},
function(error) {
trace('setStatus(\'CreateOffer failed!\');')
});
Whats the issue in this code flow?
Thanks