Skip to content

Commit

Permalink
fix(JingleSessionPC): no media flowing after ICE restart
Browse files Browse the repository at this point in the history
If DTLS fingerprint remains unchanged after ice-restart there will be no
media flow even thought the ICE connection will be re-established.
That's because JVB has all layers re-initialized from scratch, but
the WebRTC stack will keep the current state of the DTLS layer.

Reset the DTLS layer by setting an all zeros fingerprint on the hacky
offer/answer cycle which is currently done in order to reset the data
channels and the sequence number counters on the RTP receivers.
  • Loading branch information
paweldomas committed Sep 4, 2019
1 parent 9366fd6 commit 00920c0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions modules/xmpp/JingleSessionPC.js
Original file line number Diff line number Diff line change
Expand Up @@ -1040,6 +1040,15 @@ export default class JingleSessionPC extends JingleSession {
.find('>content>description>ssrc-group')
.remove();

// On the JVB it's not a real ICE restart and all layers are re-initialized from scratch as Jicofo does
// the restart by re-allocating new channels. Chrome (or WebRTC stack) needs to have the DTLS transport layer
// reset to start a new handshake with fresh DTLS transport on the bridge. Make it think that the DTLS
// fingerprint has changed by setting an all zeros key.
const newFingerprint = jingleOfferElem.find('>content>transport>fingerprint');

newFingerprint.attr('hash', 'sha-1');
newFingerprint.text('00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00');

// First set an offer with a rejected 'data' section
this.setOfferAnswerCycle(
jingleOfferElem,
Expand Down

0 comments on commit 00920c0

Please sign in to comment.