From ddc44dc75f50df4c2ce07cdf8bf80f97a03b2569 Mon Sep 17 00:00:00 2001 From: Boris Grozev Date: Tue, 5 Aug 2014 16:02:49 +0200 Subject: [PATCH] Only includes an rtcp-mux element inside 'transport'. --- libs/colibri/colibri.focus.js | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/libs/colibri/colibri.focus.js b/libs/colibri/colibri.focus.js index 62c5b4bb9..cd30c1139 100644 --- a/libs/colibri/colibri.focus.js +++ b/libs/colibri/colibri.focus.js @@ -303,9 +303,6 @@ ColibriFocus.prototype._makeConference = function () { elem.c(elemName, elemAttrs); elem.attrs({ endpoint: peer.substr(1 + peer.lastIndexOf('/')) }); - if ('channel' === elemName && config.useRtcpMux) { - elem.c('rtcp-mux').up(); - } elem.up(); // end of channel/sctpconnection } elem.up(); // end of content @@ -781,9 +778,6 @@ ColibriFocus.prototype.addNewParticipant = function (peer) { elem.c('content', { name: name }); elem.c(elemName, elemAttrs); - if ('channel' === elemName && config.useRtcpMux) { - elem.c('rtcp-mux').up(); - } elem.up(); // end of channel/sctpconnection elem.up(); // end of content }); @@ -831,9 +825,6 @@ ColibriFocus.prototype.updateChannel = function (remoteSDP, participant) { endpoint: $(this.channels[participant][channel]).attr('endpoint'), expire: self.channelExpire }); - if (config.useRtcpMux) { - change.c('rtcp-mux').up(); - } var rtpmap = SDPUtil.find_lines(remoteSDP.media[channel], 'a=rtpmap:'); rtpmap.forEach(function (val) { @@ -1044,10 +1035,6 @@ ColibriFocus.prototype.addIceCandidate = function (session, elem) { endpoint: $(self.channels[participant][channel]).attr('endpoint'), expire: self.channelExpire }); - - if (config.useRtcpMux) { - change.c('rtcp-mux').up(); - } } else { @@ -1062,6 +1049,10 @@ ColibriFocus.prototype.addIceCandidate = function (session, elem) { pwd: $(this).attr('pwd'), xmlns: $(this).attr('xmlns') }); + if (config.useRtcpMux + && 'channel' === change.node.parentNode.nodeName) { + change.c('rtcp-mux').up(); + } $(this).find('>candidate').each(function () { /* not yet @@ -1131,10 +1122,6 @@ ColibriFocus.prototype.sendIceCandidates = function (candidates) { endpoint: $(this.mychannel[cands[0].sdpMLineIndex]).attr('endpoint'), expire: self.channelExpire }); - if (config.useRtcpMux) { - mycands.c('rtcp-mux').up(); - } - } else { @@ -1145,6 +1132,9 @@ ColibriFocus.prototype.sendIceCandidates = function (candidates) { }); } mycands.c('transport', {xmlns: 'urn:xmpp:jingle:transports:ice-udp:1'}); + if (config.useRtcpMux && name !== 'data') { + mycands.c('rtcp-mux').up(); + } for (var i = 0; i < cands.length; i++) { mycands.c('candidate', SDPUtil.candidateToJingle(cands[i].candidate)).up(); }