|
@@ -1,5 +1,6 @@
|
1
|
1
|
/* global $ */
|
2
|
2
|
|
|
3
|
+import browser from '../browser';
|
3
|
4
|
import SDPUtil from './SDPUtil';
|
4
|
5
|
|
5
|
6
|
/**
|
|
@@ -318,7 +319,7 @@ SDP.prototype.toJingle = function(elem, thecreator) {
|
318
|
319
|
|
319
|
320
|
const ridLines = SDPUtil.findLines(this.media[i], 'a=rid');
|
320
|
321
|
|
321
|
|
- if (ridLines.length) {
|
|
322
|
+ if (ridLines.length && browser.usesRidsForSimulcast()) {
|
322
|
323
|
// Map a line which looks like "a=rid:2 send" to just
|
323
|
324
|
// the rid ("2")
|
324
|
325
|
const rids = ridLines
|
|
@@ -406,7 +407,10 @@ SDP.prototype.toJingle = function(elem, thecreator) {
|
406
|
407
|
} else if (SDPUtil.findLine(m, 'a=inactive', this.session)) {
|
407
|
408
|
elem.attrs({ senders: 'none' });
|
408
|
409
|
}
|
409
|
|
- if (mline.port === '0') {
|
|
410
|
+
|
|
411
|
+ // Reject an m-line only when port is 0 and a=bundle-only is not present in the section.
|
|
412
|
+ // The port is automatically set to 0 when bundle-only is used.
|
|
413
|
+ if (mline.port === '0' && !SDPUtil.findLine(m, 'a=bundle-only', this.session)) {
|
410
|
414
|
// estos hack to reject an m-line
|
411
|
415
|
elem.attrs({ senders: 'rejected' });
|
412
|
416
|
}
|
|
@@ -566,9 +570,11 @@ SDP.prototype.rtcpFbFromJingle = function(elem, payloadtype) { // XEP-0293
|
566
|
570
|
// construct an SDP from a jingle stanza
|
567
|
571
|
SDP.prototype.fromJingle = function(jingle) {
|
568
|
572
|
const self = this;
|
|
573
|
+ const sessionId = (new Date()).getTime();
|
569
|
574
|
|
|
575
|
+ // Use a unique session id for every TPC.
|
570
|
576
|
this.raw = 'v=0\r\n'
|
571
|
|
- + 'o=- 1923518516 2 IN IP4 0.0.0.0\r\n'// FIXME
|
|
577
|
+ + `o=- ${sessionId} 2 IN IP4 0.0.0.0\r\n`
|
572
|
578
|
+ 's=-\r\n'
|
573
|
579
|
+ 't=0 0\r\n';
|
574
|
580
|
|