|
|
@@ -59,6 +59,12 @@ function JingleSessionPC(me, sid, peerjid, connection,
|
|
59
|
59
|
this.jingleOfferIq = null;
|
|
60
|
60
|
this.webrtcIceUdpDisable = !!this.service.options.webrtcIceUdpDisable;
|
|
61
|
61
|
this.webrtcIceTcpDisable = !!this.service.options.webrtcIceTcpDisable;
|
|
|
62
|
+ /**
|
|
|
63
|
+ * Flag used to enforce ICE failure through the URL parameter for
|
|
|
64
|
+ * the automatic testing purpose.
|
|
|
65
|
+ * @type {boolean}
|
|
|
66
|
+ */
|
|
|
67
|
+ this.failICE = !!this.service.options.failICE;
|
|
62
|
68
|
|
|
63
|
69
|
this.modifySourcesQueue = async.queue(this._modifySources.bind(this), 1);
|
|
64
|
70
|
}
|
|
|
@@ -212,7 +218,12 @@ JingleSessionPC.prototype.sendIceCandidates = function (candidates) {
|
|
212
|
218
|
name: (cands[0].sdpMid? cands[0].sdpMid : mline.media)
|
|
213
|
219
|
}).c('transport', ice);
|
|
214
|
220
|
for (var i = 0; i < cands.length; i++) {
|
|
215
|
|
- cand.c('candidate', SDPUtil.candidateToJingle(cands[i].candidate)).up();
|
|
|
221
|
+ var candidate = SDPUtil.candidateToJingle(cands[i].candidate);
|
|
|
222
|
+ // Mangle ICE candidate if 'failICE' test option is enabled
|
|
|
223
|
+ if (this.service.options.failICE) {
|
|
|
224
|
+ candidate.ip = "1.1.1.1";
|
|
|
225
|
+ }
|
|
|
226
|
+ cand.c('candidate', candidate).up();
|
|
216
|
227
|
}
|
|
217
|
228
|
// add fingerprint
|
|
218
|
229
|
var fingerprint_line = SDPUtil.find_line(this.localSDP.media[mid], 'a=fingerprint:', this.localSDP.session);
|
|
|
@@ -423,6 +434,9 @@ JingleSessionPC.prototype.sendSessionAccept = function (localSDP,
|
|
423
|
434
|
if (this.webrtcIceUdpDisable) {
|
|
424
|
435
|
localSDP.removeUdpCandidates = true;
|
|
425
|
436
|
}
|
|
|
437
|
+ if (this.failICE) {
|
|
|
438
|
+ localSDP.failICE = true;
|
|
|
439
|
+ }
|
|
426
|
440
|
localSDP.toJingle(
|
|
427
|
441
|
accept,
|
|
428
|
442
|
this.initiator == this.me ? 'initiator' : 'responder',
|
|
|
@@ -755,6 +769,9 @@ JingleSessionPC.prototype._modifySources = function (successCallback, queueCallb
|
|
755
|
769
|
if (this.webrtcIceUdpDisable) {
|
|
756
|
770
|
sdp.removeUdpCandidates = true;
|
|
757
|
771
|
}
|
|
|
772
|
+ if (this.failICE) {
|
|
|
773
|
+ sdp.failICE = true;
|
|
|
774
|
+ }
|
|
758
|
775
|
|
|
759
|
776
|
sdp.fromJingle(this.jingleOfferIq);
|
|
760
|
777
|
this.readSsrcInfo($(this.jingleOfferIq).find(">content"));
|