otalk / rtcpeerconnection-shim

Implementation of the RTCPeerConnection API ontop of ORTC
BSD 3-Clause "New" or "Revised" License
15 stars 14 forks source link

createOffer should ignore rejected datachannel transceivers #178

Open fippo opened 5 years ago

fippo commented 5 years ago
  it.only('...', () => {
    const sdp = SDP_BOILERPLATE +
        'm=application 9 DTLS/SCTP 5000\r\n' +
        'c=IN IP4 0.0.0.0\r\n' +
        'a=ice-ufrag:' + ICEUFRAG + '\r\n' +
        'a=ice-pwd:' + ICEPWD + '\r\n' +
        'a=fingerprint:sha-256 ' + FINGERPRINT_SHA256 + '\r\n' +
        'a=setup:actpass\r\n' +
        'a=mid:data\r\n' +
        'a=sctpmap:5000 webrtc-datachannel 1024\r\n';
    const pc = new RTCPeerConnection();
    pc.setRemoteDescription({type: 'offer', sdp})
      .then(() => pc.createAnswer())
      .then((answer) => pc.setLocalDescription(answer))
      .then(() => pc.createOffer())
      .then((offer) => console.log(offer.sdp))
  });

throws

(node:31948) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'getLocalParameters' of undefined
    at module.exports (/home/fippo/webrtc/wicked/writemediasection.js:21:31)

createOffer should skip over rejected datachannel m-lines the same way createAnswer does.

fippo commented 5 years ago

potentially #166 in disguise