I am working with the Answering a call documentation of Mozilla to answer a WebRTC call in Mozilla Firefox 35.0.1 but everytime I try to set a local description on the peer connection it fails.
The error is an INTERNAL_ERROR with the message:
Cannot start media channels cause = OK
My code is written in CoffeeScript but is hopefully easy to read:
_create_answer: =>
# @param {mozRTCSessionDescription} answer the SDP answer.
on_answer_success = (answer) =>
console.log 'Create Answer: OK', answer
on_local_sdp_success = () =>
console.log 'Set local SDP (answer): OK'
@_send_local_sdp answer
on_local_sdp_failure = (error) =>
console.log "#{error.name} - #{error.message}"
console.log '(5) Set local SDP.', @logger.levels.INFO
@pc.setLocalDescription answer, on_local_sdp_success, on_local_sdp_failure
As you can see, setting the local description on the peer connection is the fifth step. Here are the steps that I do before:
- Request user media stream (
navigator.getUserMedia
) - Set local media stream (
pc.addStream / pc.onaddstream
) - Set remote SDP (
pc.setRemoteDescription
) - Create answer (
pc.createAnswer
) - Set local SDP (
pc.setLocalDescription
)
Here is the SDP answer that Firefox generates and which I try to set to the peer connection via pc.setLocalDescription
:
v=0
o=Mozilla-SIPUA-35.0.1 2330 0 IN IP4 0.0.0.0
s=SIP Call
t=0 0
a=ice-ufrag:c6dc3e0f
a=ice-pwd:8ab875b276043fa2e76effc4fbe77014
a=fingerprint:sha-256 F5:53:7F:74:A4:3E:27:8F:4B:BC:64:37:ED:96:BD:2D:0D:22:49:FB:E5:AF:8C:E7:05:41:5F:EF:7F:F1:D9:A0
m=audio 9 RTP/SAVPF 96
c=IN IP4 0.0.0.0
a=rtpmap:96 opus/48000/2
a=ptime:20
a=sendrecv
a=setup:active
a=rtcp-mux
Do I need to pay attention to something else?