|
@@ -40,6 +40,7 @@ import Statistics from './modules/statistics/statistics';
|
40
|
40
|
import EventEmitter from './modules/util/EventEmitter';
|
41
|
41
|
import { safeSubtract } from './modules/util/MathUtil';
|
42
|
42
|
import RandomUtil from './modules/util/RandomUtil';
|
|
43
|
+import { getJitterDelay } from './modules/util/Retry';
|
43
|
44
|
import ComponentsVersions from './modules/version/ComponentsVersions';
|
44
|
45
|
import VideoSIPGW from './modules/videosipgw/VideoSIPGW';
|
45
|
46
|
import * as VideoSIPGWConstants from './modules/videosipgw/VideoSIPGWConstants';
|
|
@@ -325,6 +326,11 @@ export default function JitsiConference(options) {
|
325
|
326
|
|
326
|
327
|
this._firefoxP2pEnabled = browser.isVersionGreaterThan(109)
|
327
|
328
|
&& (this.options.config.testing?.enableFirefoxP2p ?? true);
|
|
329
|
+
|
|
330
|
+ /**
|
|
331
|
+ * Number of times ICE restarts that have been attempted after ICE connectivity with the JVB was lost.
|
|
332
|
+ */
|
|
333
|
+ this._iceRestarts = 0;
|
328
|
334
|
}
|
329
|
335
|
|
330
|
336
|
// FIXME convert JitsiConference to ES6 - ASAP !
|
|
@@ -418,24 +424,21 @@ JitsiConference.prototype._init = function(options = {}) {
|
418
|
424
|
}
|
419
|
425
|
});
|
420
|
426
|
|
421
|
|
- // Connection interrupted/restored listeners
|
422
|
|
- this._onIceConnectionInterrupted
|
423
|
|
- = this._onIceConnectionInterrupted.bind(this);
|
424
|
|
- this.room.addListener(
|
425
|
|
- XMPPEvents.CONNECTION_INTERRUPTED, this._onIceConnectionInterrupted);
|
|
427
|
+ // ICE Connection interrupted/restored listeners.
|
|
428
|
+ this._onIceConnectionEstablished = this._onIceConnectionEstablished.bind(this);
|
|
429
|
+ this.room.addListener(XMPPEvents.CONNECTION_ESTABLISHED, this._onIceConnectionEstablished);
|
426
|
430
|
|
427
|
|
- this._onIceConnectionRestored = this._onIceConnectionRestored.bind(this);
|
428
|
|
- this.room.addListener(
|
429
|
|
- XMPPEvents.CONNECTION_RESTORED, this._onIceConnectionRestored);
|
|
431
|
+ this._onIceConnectionFailed = this._onIceConnectionFailed.bind(this);
|
|
432
|
+ this.room.addListener(XMPPEvents.CONNECTION_ICE_FAILED, this._onIceConnectionFailed);
|
430
|
433
|
|
431
|
|
- this._onIceConnectionEstablished
|
432
|
|
- = this._onIceConnectionEstablished.bind(this);
|
433
|
|
- this.room.addListener(
|
434
|
|
- XMPPEvents.CONNECTION_ESTABLISHED, this._onIceConnectionEstablished);
|
|
434
|
+ this._onIceConnectionInterrupted = this._onIceConnectionInterrupted.bind(this);
|
|
435
|
+ this.room.addListener(XMPPEvents.CONNECTION_INTERRUPTED, this._onIceConnectionInterrupted);
|
|
436
|
+
|
|
437
|
+ this._onIceConnectionRestored = this._onIceConnectionRestored.bind(this);
|
|
438
|
+ this.room.addListener(XMPPEvents.CONNECTION_RESTORED, this._onIceConnectionRestored);
|
435
|
439
|
|
436
|
440
|
this._updateProperties = this._updateProperties.bind(this);
|
437
|
|
- this.room.addListener(XMPPEvents.CONFERENCE_PROPERTIES_CHANGED,
|
438
|
|
- this._updateProperties);
|
|
441
|
+ this.room.addListener(XMPPEvents.CONFERENCE_PROPERTIES_CHANGED, this._updateProperties);
|
439
|
442
|
|
440
|
443
|
this._sendConferenceJoinAnalyticsEvent = this._sendConferenceJoinAnalyticsEvent.bind(this);
|
441
|
444
|
this.room.addListener(XMPPEvents.MEETING_ID_SET, this._sendConferenceJoinAnalyticsEvent);
|
|
@@ -2854,8 +2857,15 @@ JitsiConference.prototype._onIceConnectionFailed = function(session) {
|
2854
|
2857
|
reasonDescription: 'ICE FAILED'
|
2855
|
2858
|
});
|
2856
|
2859
|
} else if (session && this.jvbJingleSession === session) {
|
|
2860
|
+ // Use an exponential backoff timer for ICE restarts.
|
|
2861
|
+ const jitterDelay = getJitterDelay(this._iceRestarts, 1000 /* min. delay */);
|
|
2862
|
+
|
2857
|
2863
|
this._delayedIceFailed = new IceFailedHandling(this);
|
2858
|
|
- this._delayedIceFailed.start(session);
|
|
2864
|
+ setTimeout(() => {
|
|
2865
|
+ logger.error(`triggering ice restart after ${jitterDelay} `);
|
|
2866
|
+ this._delayedIceFailed.start(session);
|
|
2867
|
+ this._iceRestarts++;
|
|
2868
|
+ }, jitterDelay);
|
2859
|
2869
|
}
|
2860
|
2870
|
};
|
2861
|
2871
|
|