Bladeren bron

fix(JingleSession) Remove ice restart option and functionality. (#2586)

release-8443
Jaya Allamsetty 1 jaar geleden
bovenliggende
commit
fac989a94d
No account linked to committer's email address

+ 0
- 2
JitsiConference.js Bestand weergeven

@@ -106,8 +106,6 @@ function _getCodecMimeType(codec) {
106 106
  * @param {number} [options.config.avgRtpStatsN=15] how many samples are to be
107 107
  * collected by {@link AvgRTPStatsReporter}, before arithmetic mean is
108 108
  * calculated and submitted to the analytics module.
109
- * @param {boolean} [options.config.enableIceRestart=false] - enables the ICE
110
- * restart logic.
111 109
  * @param {boolean} [options.config.p2p.enabled] when set to <tt>true</tt>
112 110
  * the peer to peer mode will be enabled. It means that when there are only 2
113 111
  * participants in the conference an attempt to make direct connection will be

+ 0
- 24
JitsiConferenceEventManager.js Bestand weergeven

@@ -42,19 +42,6 @@ JitsiConferenceEventManager.prototype.setupChatRoomListeners = function() {
42 42
     this.chatRoomForwarder = new EventEmitterForwarder(chatRoom,
43 43
         this.conference.eventEmitter);
44 44
 
45
-    chatRoom.addListener(XMPPEvents.ICE_RESTARTING, jingleSession => {
46
-        if (!jingleSession.isP2P) {
47
-            // If using DataChannel as bridge channel, it must be closed
48
-            // before ICE restart, otherwise Chrome will not trigger "opened"
49
-            // event for the channel established with the new bridge.
50
-            // TODO: This may be bypassed when using a WebSocket as bridge
51
-            // channel.
52
-            conference.rtc.closeBridgeChannel();
53
-        }
54
-
55
-        // else: there are no DataChannels in P2P session (at least for now)
56
-    });
57
-
58 45
     chatRoom.addListener(XMPPEvents.PARTICIPANT_FEATURES_CHANGED, (from, features) => {
59 46
         const participant = conference.getParticipantById(Strophe.getResourceFromJid(from));
60 47
 
@@ -64,17 +51,6 @@ JitsiConferenceEventManager.prototype.setupChatRoomListeners = function() {
64 51
         }
65 52
     });
66 53
 
67
-    chatRoom.addListener(
68
-        XMPPEvents.ICE_RESTART_SUCCESS,
69
-        (jingleSession, offerIq) => {
70
-            // The JVB data chanel needs to be reopened in case the conference
71
-            // has been moved to a new bridge.
72
-            !jingleSession.isP2P
73
-                && conference._setBridgeChannel(
74
-                    offerIq, jingleSession.peerconnection);
75
-        });
76
-
77
-
78 54
     chatRoom.addListener(XMPPEvents.AUDIO_MUTED_BY_FOCUS,
79 55
         actor => {
80 56
             // TODO: Add a way to differentiate between commands which caused

+ 18
- 35
modules/connectivity/IceFailedHandling.js Bestand weergeven

@@ -8,13 +8,10 @@ const logger = getLogger(__filename);
8 8
 /**
9 9
  * This class deals with shenanigans around JVB media session's ICE failed status handling.
10 10
  *
11
- * If ICE restarts are NOT explicitly enabled by the {@code enableIceRestart} config option, then the conference will
12
- * delay emitting the {@JitsiConferenceErrors.ICE_FAILED} event by 15 seconds. If the network info module reports
13
- * the internet offline status then the time will start counting after the internet comes back online.
14
- *
15
- * If ICE restart are enabled, then a delayed ICE failed notification to Jicofo will be sent, only if the ICE connection
16
- * does not recover soon after or before the XMPP connection is restored (if it was ever broken). If ICE fails while
17
- * the XMPP connection is not broken then the notifications will be sent after 2 seconds delay.
11
+ * If ICE connection is not re-established within 2 secs after the internet comes back online, the client will initiate
12
+ * a session restart via 'session-terminate'. This results in Jicofo re-inviting the participant into the conference by
13
+ * recreating the jvb media session so that there is minimla disruption to the user by default. However, if the
14
+ * 'enableForcedReload' option is set in config.js, the conference will be forcefully reloaded.
18 15
  */
19 16
 export default class IceFailedHandling {
20 17
     /**
@@ -36,23 +33,15 @@ export default class IceFailedHandling {
36 33
             return;
37 34
         }
38 35
 
39
-        const { enableForcedReload, enableIceRestart } = this._conference.options.config;
40
-        const explicitlyDisabled = typeof enableIceRestart !== 'undefined' && !enableIceRestart;
41
-        const supportsRestartByTerminate = this._conference.room.supportsRestartByTerminate();
42
-        const useTerminateForRestart = supportsRestartByTerminate && !enableIceRestart;
43
-
44
-        logger.info('ICE failed,'
45
-            + ` enableForcedReload: ${enableForcedReload},`
46
-            + ` enableIceRestart: ${enableIceRestart},`
47
-            + ` supports restart by terminate: ${supportsRestartByTerminate}`);
36
+        const { enableForcedReload } = this._conference.options.config;
48 37
 
49
-        if (explicitlyDisabled || (!enableIceRestart && !supportsRestartByTerminate) || enableForcedReload) {
50
-            logger.info('ICE failed, but ICE restarts are disabled');
51
-            const reason = enableForcedReload
52
-                ? JitsiConferenceErrors.CONFERENCE_RESTARTED
53
-                : JitsiConferenceErrors.ICE_FAILED;
38
+        logger.info(`ICE failed, enableForcedReload: ${enableForcedReload}`);
54 39
 
55
-            this._conference.eventEmitter.emit(JitsiConferenceEvents.CONFERENCE_FAILED, reason);
40
+        if (enableForcedReload) {
41
+            logger.info('ICE failed, force reloading the conference');
42
+            this._conference.eventEmitter.emit(
43
+                JitsiConferenceEvents.CONFERENCE_FAILED,
44
+                JitsiConferenceErrors.CONFERENCE_RESTARTED);
56 45
 
57 46
             return;
58 47
         }
@@ -65,19 +54,13 @@ export default class IceFailedHandling {
65 54
         } else if (jvbConnIceState === 'connected') {
66 55
             logger.info('ICE connection restored - not sending ICE failed');
67 56
         } else {
68
-            logger.info('Sending ICE failed - the connection did not recover, '
69
-                + `ICE state: ${jvbConnIceState}, `
70
-                + `use 'session-terminate': ${useTerminateForRestart}`);
71
-            if (useTerminateForRestart) {
72
-                this._conference._stopJvbSession({
73
-                    reason: 'connectivity-error',
74
-                    reasonDescription: 'ICE FAILED',
75
-                    requestRestart: true,
76
-                    sendSessionTerminate: true
77
-                });
78
-            } else {
79
-                this._conference.jvbJingleSession.sendIceFailedNotification();
80
-            }
57
+            logger.info(`Sending ICE failed - the connection did not recover, ICE state: ${jvbConnIceState}`);
58
+            this._conference._stopJvbSession({
59
+                reason: 'connectivity-error',
60
+                reasonDescription: 'ICE FAILED',
61
+                requestRestart: true,
62
+                sendSessionTerminate: true
63
+            });
81 64
         }
82 65
     }
83 66
 

+ 17
- 80
modules/connectivity/IceFailedHandling.spec.js Bestand weergeven

@@ -36,9 +36,7 @@ describe('IceFailedHandling', () => {
36 36
             // eslint-disable-next-line no-empty-function
37 37
             emit: () => { }
38 38
         };
39
-        mockConference.room = {
40
-            supportsRestartByTerminate: () => false
41
-        };
39
+        mockConference.room = {};
42 40
         mockConference.xmpp = {
43 41
             ping: () => Promise.resolve()
44 42
         };
@@ -49,83 +47,11 @@ describe('IceFailedHandling', () => {
49 47
         jasmine.clock().uninstall();
50 48
     });
51 49
 
52
-    describe('when ICE restarts are disabled', () => {
53
-        beforeEach(() => {
54
-            mockConference.options.config.enableIceRestart = false;
55
-        });
56
-        it('emits ICE failed with 2 seconds delay after XMPP ping comes through', () => {
57
-            iceFailedHandling.start();
58
-
59
-            return nextTick() // tick for ping
60
-                .then(() => {
61
-                    expect(emitEventSpy).not.toHaveBeenCalled();
62
-
63
-                    return nextTick(2500); // tick for the 2 sec ice timeout
64
-                })
65
-                .then(() => {
66
-                    expect(emitEventSpy).toHaveBeenCalled();
67
-                });
68
-        });
69
-        it('cancel method cancels the ICE failed event', () => {
70
-            iceFailedHandling.start();
71
-
72
-            return nextTick(1000) // tick for ping
73
-                .then(() => {
74
-                    expect(emitEventSpy).not.toHaveBeenCalled();
75
-                    iceFailedHandling.cancel();
76
-
77
-                    return nextTick(2500); // tick for ice timeout
78
-                })
79
-                .then(() => {
80
-                    expect(emitEventSpy).not.toHaveBeenCalled();
81
-                });
82
-        });
83
-    });
84
-    describe('when ICE restart are enabled', () => {
85
-        let sendIceFailedSpy;
86
-
87
-        beforeEach(() => {
88
-            mockConference.options.config.enableIceRestart = true;
89
-            mockConference.jvbJingleSession = {
90
-                getIceConnectionState: () => 'failed',
91
-                // eslint-disable-next-line no-empty-function
92
-                sendIceFailedNotification: () => { }
93
-            };
94
-            sendIceFailedSpy = spyOn(mockConference.jvbJingleSession, 'sendIceFailedNotification');
95
-        });
96
-        it('send ICE failed notification to Jicofo', () => {
97
-            iceFailedHandling.start();
98
-
99
-            return nextTick() // tick for ping
100
-                .then(() => nextTick(2500)) // tick for ice timeout
101
-                .then(() => {
102
-                    expect(sendIceFailedSpy).toHaveBeenCalled();
103
-                });
104
-        });
105
-        it('not send ICE failed notification to Jicofo if canceled', () => {
106
-            iceFailedHandling.start();
107
-
108
-            // first it send ping which is async - need next tick
109
-            return nextTick(1000)
110
-                .then(() => {
111
-                    expect(sendIceFailedSpy).not.toHaveBeenCalled();
112
-                    iceFailedHandling.cancel();
113
-
114
-                    return nextTick(3000); // tick for ice timeout
115
-                })
116
-                .then(() => {
117
-                    expect(sendIceFailedSpy).not.toHaveBeenCalled();
118
-                });
119
-        });
120
-    });
121 50
     describe('if Jingle session restarts are supported', () => {
122 51
         let sendSessionTerminateSpy;
123 52
 
124 53
         beforeEach(() => {
125
-            mockConference.options.config.enableIceRestart = undefined;
126
-            mockConference.room = {
127
-                supportsRestartByTerminate: () => true
128
-            };
54
+            mockConference.room = {};
129 55
             mockConference.jvbJingleSession = {
130 56
                 getIceConnectionState: () => 'failed',
131 57
                 // eslint-disable-next-line no-empty-function
@@ -148,15 +74,26 @@ describe('IceFailedHandling', () => {
148 74
                         });
149 75
                 });
150 76
         });
77
+        it('cancel method cancels the call to terminate session', () => {
78
+            iceFailedHandling.start();
79
+
80
+            return nextTick(1000) // tick for ping
81
+                .then(() => {
82
+                    expect(sendSessionTerminateSpy).not.toHaveBeenCalled();
83
+                    iceFailedHandling.cancel();
84
+
85
+                    return nextTick(2500); // tick for ice timeout
86
+                })
87
+                .then(() => {
88
+                    expect(sendSessionTerminateSpy).not.toHaveBeenCalled();
89
+                });
90
+        });
151 91
     });
152 92
     describe('when forced reloads are enabled', () => {
153 93
         beforeEach(() => {
154
-            mockConference.options.config.enableIceRestart = undefined;
155 94
             mockConference.options.config.enableForcedReload = true;
156 95
 
157
-            mockConference.room = {
158
-                supportsRestartByTerminate: () => true
159
-            };
96
+            mockConference.room = {};
160 97
         });
161 98
 
162 99
         it('emits conference restarted when force reloads are enabled', () => {

+ 1
- 2
modules/proxyconnection/ProxyConnectionPC.js Bestand weergeven

@@ -225,8 +225,7 @@ export default class ProxyConnectionPC {
225 225
             connectionTimes: [],
226 226
             eventEmitter: { emit: emitter },
227 227
             removeEventListener: () => { /* no op */ },
228
-            removePresenceListener: () => { /* no-op */ },
229
-            supportsRestartByTerminate: () => false
228
+            removePresenceListener: () => { /* no-op */ }
230 229
         };
231 230
 
232 231
         /**

+ 0
- 15
modules/xmpp/ChatRoom.js Bestand weergeven

@@ -816,13 +816,6 @@ export default class ChatRoom extends Listenable {
816 816
                     }
817 817
 
818 818
                     this.eventEmitter.emit(XMPPEvents.CONFERENCE_PROPERTIES_CHANGED, properties);
819
-
820
-                    // Log if Jicofo supports restart by terminate only once. This conference property does not change
821
-                    // during the call.
822
-                    if (typeof this.restartByTerminateSupported === 'undefined') {
823
-                        this.restartByTerminateSupported = properties['support-terminate-restart'] === 'true';
824
-                        logger.info(`Jicofo supports restart by terminate: ${this.supportsRestartByTerminate()}`);
825
-                    }
826 819
                 }
827 820
                 break;
828 821
             case 'transcription-status': {
@@ -913,14 +906,6 @@ export default class ChatRoom extends Listenable {
913 906
         this.participantPropertyListener = listener;
914 907
     }
915 908
 
916
-    /**
917
-     * Checks if Jicofo supports restarting Jingle session after 'session-terminate'.
918
-     * @returns {boolean}
919
-     */
920
-    supportsRestartByTerminate() {
921
-        return this.restartByTerminateSupported;
922
-    }
923
-
924 909
     /**
925 910
      *
926 911
      * @param node

+ 3
- 231
modules/xmpp/JingleSessionPC.js Bestand weergeven

@@ -197,7 +197,7 @@ export default class JingleSessionPC extends JingleSession {
197 197
          * The bridge session's identifier. One Jingle session can during
198 198
          * it's lifetime participate in multiple bridge sessions managed by
199 199
          * Jicofo. A new bridge session is started whenever Jicofo sends
200
-         * 'session-initiate' or 'transport-replace'.
200
+         * 'session-initiate'.
201 201
          *
202 202
          * @type {?string}
203 203
          * @private
@@ -277,8 +277,7 @@ export default class JingleSessionPC extends JingleSession {
277 277
 
278 278
         /**
279 279
          * Marks that ICE gathering duration has been reported already. That
280
-         * prevents reporting it again, after eventual 'transport-replace' (JVB
281
-         * conference migration/ICE restart).
280
+         * prevents reporting it again.
282 281
          * @type {boolean}
283 282
          * @private
284 283
          */
@@ -544,13 +543,7 @@ export default class JingleSessionPC extends JingleSession {
544 543
                 // media connection to the bridge has been restored after an ICE failure by using session-terminate.
545 544
                 if (this.peerconnection.signalingState === 'stable') {
546 545
                     isStable = true;
547
-                    const usesTerminateForRestart = !this.options.enableIceRestart
548
-                        && this.room.supportsRestartByTerminate();
549
-
550
-                    if (this.isReconnect || usesTerminateForRestart) {
551
-                        this.room.eventEmitter.emit(
552
-                            XMPPEvents.CONNECTION_RESTORED, this);
553
-                    }
546
+                    this.room.eventEmitter.emit(XMPPEvents.CONNECTION_RESTORED, this);
554 547
                 }
555 548
 
556 549
                 // Add a workaround for an issue on chrome in Unified plan when the local endpoint is the offerer.
@@ -817,45 +810,6 @@ export default class JingleSessionPC extends JingleSession {
817 810
             cand, null, this.newJingleErrorHandler(cand), IQ_TIMEOUT);
818 811
     }
819 812
 
820
-    /**
821
-     * Sends Jingle 'session-info' message which includes custom Jitsi Meet
822
-     * 'ice-state' element with the text value 'failed' to let Jicofo know
823
-     * that the ICE connection has entered the failed state. It can then
824
-     * choose to re-create JVB channels and send 'transport-replace' to
825
-     * retry the connection.
826
-     */
827
-    sendIceFailedNotification() {
828
-        const sessionInfo
829
-            = $iq({
830
-                to: this.remoteJid,
831
-                type: 'set' })
832
-            .c('jingle', { xmlns: 'urn:xmpp:jingle:1',
833
-                action: 'session-info',
834
-                initiator: this.initiatorJid,
835
-                sid: this.sid })
836
-            .c('ice-state', { xmlns: 'http://jitsi.org/protocol/focus' })
837
-            .t('failed')
838
-            .up();
839
-
840
-        this._bridgeSessionId
841
-            && sessionInfo.c(
842
-                'bridge-session', {
843
-                    xmlns: 'http://jitsi.org/protocol/focus',
844
-                    id: this._bridgeSessionId
845
-                });
846
-
847
-        this.connection.sendIQ2(
848
-            sessionInfo, {
849
-                /*
850
-                 * This message will be often sent when there are connectivity
851
-                 * issues, so make it slightly longer than Prosody's default BOSH
852
-                 * inactivity timeout of 60 seconds.
853
-                 */
854
-                timeout: 65
855
-            })
856
-            .catch(this.newJingleErrorHandler(sessionInfo));
857
-    }
858
-
859 813
     /**
860 814
      * {@inheritDoc}
861 815
      */
@@ -1233,111 +1187,6 @@ export default class JingleSessionPC extends JingleSession {
1233 1187
         }
1234 1188
     }
1235 1189
 
1236
-    /* eslint-enable max-params */
1237
-
1238
-    /**
1239
-     * Although it states "replace transport" it does accept full Jingle offer
1240
-     * which should contain new ICE transport details.
1241
-     * @param jingleOfferElem an element Jingle IQ that contains new offer and
1242
-     *        transport info.
1243
-     * @param success callback called when we succeed to accept new offer.
1244
-     * @param failure function(error) called when we fail to accept new offer.
1245
-     */
1246
-    replaceTransport(jingleOfferElem, success, failure) {
1247
-        if (this.options.enableForcedReload) {
1248
-            const sdp = new SDP(this.peerconnection.localDescription.sdp);
1249
-
1250
-            this.sendTransportAccept(sdp, success, failure);
1251
-            this.room.eventEmitter.emit(XMPPEvents.CONNECTION_RESTARTED, this);
1252
-
1253
-            return;
1254
-        }
1255
-        this.room.eventEmitter.emit(XMPPEvents.ICE_RESTARTING, this);
1256
-
1257
-        // We need to first reject the 'data' section to have the SCTP stack
1258
-        // cleaned up to signal the known data channel is now invalid. After
1259
-        // that the original offer is set to have the SCTP connection
1260
-        // established with the new bridge.
1261
-        const originalOffer = jingleOfferElem.clone();
1262
-
1263
-        jingleOfferElem
1264
-            .find('>content[name=\'data\']')
1265
-            .attr('senders', 'rejected');
1266
-
1267
-        // Remove all remote sources in order to reset the client's state
1268
-        // for the remote MediaStreams. When a conference is moved to
1269
-        // another bridge it will start streaming with a sequence number
1270
-        // that is not in sync with the most recently seen by the client.
1271
-        // The symptoms include frozen or black video and lots of "failed to
1272
-        // unprotect SRTP packets" in Chrome logs.
1273
-        jingleOfferElem
1274
-            .find('>content>description>source')
1275
-            .remove();
1276
-        jingleOfferElem
1277
-            .find('>content>description>ssrc-group')
1278
-            .remove();
1279
-
1280
-        // On the JVB it's not a real ICE restart and all layers are re-initialized from scratch as Jicofo does
1281
-        // the restart by re-allocating new channels. Chrome (or WebRTC stack) needs to have the DTLS transport layer
1282
-        // reset to start a new handshake with fresh DTLS transport on the bridge. Make it think that the DTLS
1283
-        // fingerprint has changed by setting an all zeros key.
1284
-        const newFingerprint = jingleOfferElem.find('>content>transport>fingerprint');
1285
-
1286
-        newFingerprint.attr('hash', 'sha-1');
1287
-        newFingerprint.text('00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00');
1288
-
1289
-        const workFunction = finishedCallback => {
1290
-            // First set an offer with a rejected 'data' section
1291
-            this.setOfferAnswerCycle(
1292
-                jingleOfferElem,
1293
-                () => {
1294
-                    // Now set the original offer(with the 'data' section)
1295
-                    this.setOfferAnswerCycle(
1296
-                        originalOffer,
1297
-                        () => {
1298
-                            const localSDP = new SDP(this.peerconnection.localDescription.sdp);
1299
-
1300
-                            if (typeof this.options.channelLastN === 'number' && this.options.channelLastN >= 0) {
1301
-                                localSDP.initialLastN = this.options.channelLastN;
1302
-                            }
1303
-
1304
-                            this.sendTransportAccept(localSDP, success, failure);
1305
-
1306
-                            this.room.eventEmitter.emit(
1307
-                                XMPPEvents.ICE_RESTART_SUCCESS,
1308
-                                this,
1309
-                                originalOffer);
1310
-
1311
-                            finishedCallback();
1312
-                        }, error => finishedCallback(error)
1313
-                    );
1314
-                }, error => finishedCallback(error)
1315
-            );
1316
-        };
1317
-
1318
-        logger.debug(`${this} Queued ICE restart task`);
1319
-
1320
-        // Queue and execute
1321
-        this.modificationQueue.push(
1322
-            workFunction,
1323
-            error => {
1324
-                if (error) {
1325
-                    if (error instanceof ClearedQueueError) {
1326
-                        // The session might have been terminated before the task was executed, making it obsolete.
1327
-                        logger.debug(`${this} ICE restart task aborted: session terminated`);
1328
-                        success();
1329
-
1330
-                        return;
1331
-                    }
1332
-                    logger.error(`${this} ICE restart task failed: ${error}`);
1333
-                    failure(error);
1334
-                } else {
1335
-                    logger.debug(`${this} ICE restart task done`);
1336
-                    success();
1337
-                }
1338
-            });
1339
-    }
1340
-
1341 1190
     /**
1342 1191
      * Sends Jingle 'session-accept' message.
1343 1192
      * @param {function()} success callback called when we receive 'RESULT'
@@ -1474,83 +1323,6 @@ export default class JingleSessionPC extends JingleSession {
1474 1323
         }
1475 1324
     }
1476 1325
 
1477
-    /**
1478
-     * Sends Jingle 'transport-accept' message which is a response to
1479
-     * 'transport-replace'.
1480
-     * @param localSDP the 'SDP' object with local session description
1481
-     * @param success callback called when we receive 'RESULT' packet for
1482
-     *        'transport-replace'
1483
-     * @param failure function(error) called when we receive an error response
1484
-     *        or when the request has timed out.
1485
-     * @private
1486
-     */
1487
-    sendTransportAccept(localSDP, success, failure) {
1488
-        const transportAccept = $iq({ to: this.remoteJid,
1489
-            type: 'set' })
1490
-            .c('jingle', {
1491
-                xmlns: 'urn:xmpp:jingle:1',
1492
-                action: 'transport-accept',
1493
-                initiator: this.initiatorJid,
1494
-                sid: this.sid
1495
-            });
1496
-
1497
-        localSDP.media.forEach((medialines, idx) => {
1498
-            const mline = SDPUtil.parseMLine(medialines.split('\r\n')[0]);
1499
-
1500
-            transportAccept.c('content',
1501
-                {
1502
-                    creator:
1503
-                        this.initiatorJid === this.localJid
1504
-                            ? 'initiator'
1505
-                            : 'responder',
1506
-                    name: mline.media
1507
-                }
1508
-            );
1509
-            localSDP.transportToJingle(idx, transportAccept);
1510
-            transportAccept.up();
1511
-        });
1512
-
1513
-        logger.info(`${this} Sending transport-accept`);
1514
-        logger.debug(transportAccept.tree());
1515
-
1516
-        this.connection.sendIQ(transportAccept,
1517
-            success,
1518
-            this.newJingleErrorHandler(transportAccept, failure),
1519
-            IQ_TIMEOUT);
1520
-    }
1521
-
1522
-    /**
1523
-     * Sends Jingle 'transport-reject' message which is a response to
1524
-     * 'transport-replace'.
1525
-     * @param success callback called when we receive 'RESULT' packet for
1526
-     *        'transport-replace'
1527
-     * @param failure function(error) called when we receive an error response
1528
-     *        or when the request has timed out.
1529
-     *
1530
-     * FIXME method should be marked as private, but there's some spaghetti that
1531
-     *       needs to be fixed prior doing that
1532
-     */
1533
-    sendTransportReject(success, failure) {
1534
-        // Send 'transport-reject', so that the focus will
1535
-        // know that we've failed
1536
-        const transportReject = $iq({ to: this.remoteJid,
1537
-            type: 'set' })
1538
-            .c('jingle', {
1539
-                xmlns: 'urn:xmpp:jingle:1',
1540
-                action: 'transport-reject',
1541
-                initiator: this.initiatorJid,
1542
-                sid: this.sid
1543
-            });
1544
-
1545
-        logger.info(`${this} Sending 'transport-reject'`);
1546
-        logger.debug(transportReject.tree());
1547
-
1548
-        this.connection.sendIQ(transportReject,
1549
-            success,
1550
-            this.newJingleErrorHandler(transportReject, failure),
1551
-            IQ_TIMEOUT);
1552
-    }
1553
-
1554 1326
     /**
1555 1327
      * Sets the resolution constraint on the local camera track.
1556 1328
      * @param {number} maxFrameHeight - The user preferred max frame height.

+ 2
- 39
modules/xmpp/strophe.jingle.js Bestand weergeven

@@ -4,13 +4,7 @@ import { cloneDeep } from 'lodash-es';
4 4
 import { $iq, Strophe } from 'strophe.js';
5 5
 
6 6
 import { MediaType } from '../../service/RTC/MediaType';
7
-import {
8
-    ACTION_JINGLE_TR_RECEIVED,
9
-    ACTION_JINGLE_TR_SUCCESS,
10
-    createJingleEvent
11
-} from '../../service/statistics/AnalyticsEvents';
12 7
 import { XMPPEvents } from '../../service/xmpp/XMPPEvents';
13
-import Statistics from '../statistics/statistics';
14 8
 import RandomUtil from '../util/RandomUtil';
15 9
 
16 10
 import ConnectionPlugin from './ConnectionPlugin';
@@ -255,40 +249,9 @@ export default class JingleConnectionPlugin extends ConnectionPlugin {
255 249
             this.eventEmitter.emit(XMPPEvents.CALL_ENDED, sess, reasonCondition, reasonText);
256 250
             break;
257 251
         }
258
-        case 'transport-replace': {
259
-            logger.info('(TIME) Start transport replace:\t', now);
260
-            const transport = $(iq).find('jingle>content>transport');
261
-            const candidates = _parseIceCandidates(transport);
262
-            const iceUfrag = $(transport).attr('ufrag');
263
-            const icePwd = $(transport).attr('pwd');
264
-            const dtlsFingerprint = $(transport).find('>fingerprint')?.text();
265
-
266
-            logger.debug(`Received ${action} from ${fromJid} with iceUfrag=${iceUfrag},`
267
-            + ` icePwd=${icePwd}, DTLS fingerprint=${dtlsFingerprint}, candidates=${candidates.join(', ')}`);
268
-
269
-            Statistics.sendAnalytics(createJingleEvent(
270
-                ACTION_JINGLE_TR_RECEIVED,
271
-                {
272
-                    p2p: isP2P,
273
-                    value: now
274
-                }));
275
-
276
-            sess.replaceTransport($(iq).find('>jingle'), () => {
277
-                const successTime = window.performance.now();
278
-
279
-                logger.info('(TIME) Transport replace success:\t', successTime);
280
-                Statistics.sendAnalytics(createJingleEvent(
281
-                    ACTION_JINGLE_TR_SUCCESS,
282
-                    {
283
-                        p2p: isP2P,
284
-                        value: successTime
285
-                    }));
286
-            }, error => {
287
-                logger.error('Transport replace failed', error);
288
-                sess.sendTransportReject();
289
-            });
252
+        case 'transport-replace':
253
+            logger.error(`Ignoring ${action} from ${fromJid} as it is not supported by the client.`);
290 254
             break;
291
-        }
292 255
         case 'source-add':
293 256
             sess.addRemoteStream($(iq).find('>jingle>content'));
294 257
             break;

+ 0
- 6
service/statistics/AnalyticsEvents.spec.ts Bestand weergeven

@@ -13,8 +13,6 @@ describe( "/service/statistics/AnalyticsEvents members", () => {
13 13
         ACTION_JINGLE_SI_RECEIVED,
14 14
         ACTION_JINGLE_SI_TIMEOUT,
15 15
         ACTION_JINGLE_TERMINATE,
16
-        ACTION_JINGLE_TR_RECEIVED,
17
-        ACTION_JINGLE_TR_SUCCESS,
18 16
         ACTION_P2P_DECLINED,
19 17
         ACTION_P2P_ESTABLISHED,
20 18
         ACTION_P2P_FAILED,
@@ -61,8 +59,6 @@ describe( "/service/statistics/AnalyticsEvents members", () => {
61 59
         expect( ACTION_JINGLE_SI_RECEIVED ).toBe( 'session-initiate.received' );
62 60
         expect( ACTION_JINGLE_SI_TIMEOUT ).toBe( 'session-initiate.timeout' );
63 61
         expect( ACTION_JINGLE_TERMINATE ).toBe( 'terminate' );
64
-        expect( ACTION_JINGLE_TR_RECEIVED ).toBe( 'transport-replace.received' );
65
-        expect( ACTION_JINGLE_TR_SUCCESS ).toBe( 'transport-replace.success' );
66 62
         expect( ACTION_P2P_DECLINED ).toBe( 'decline' );
67 63
         expect( ACTION_P2P_ESTABLISHED ).toBe( 'established' );
68 64
         expect( ACTION_P2P_FAILED ).toBe( 'failed' );
@@ -88,8 +84,6 @@ describe( "/service/statistics/AnalyticsEvents members", () => {
88 84
         expect( AnalyticsEvents.ACTION_JINGLE_SI_RECEIVED ).toBe( 'session-initiate.received' );
89 85
         expect( AnalyticsEvents.ACTION_JINGLE_SI_TIMEOUT ).toBe( 'session-initiate.timeout' );
90 86
         expect( AnalyticsEvents.ACTION_JINGLE_TERMINATE ).toBe( 'terminate' );
91
-        expect( AnalyticsEvents.ACTION_JINGLE_TR_RECEIVED ).toBe( 'transport-replace.received' );
92
-        expect( AnalyticsEvents.ACTION_JINGLE_TR_SUCCESS ).toBe( 'transport-replace.success' );
93 87
         expect( AnalyticsEvents.ACTION_P2P_DECLINED ).toBe( 'decline' );
94 88
         expect( AnalyticsEvents.ACTION_P2P_ESTABLISHED ).toBe( 'established' );
95 89
         expect( AnalyticsEvents.ACTION_P2P_FAILED ).toBe( 'failed' );

+ 0
- 14
service/statistics/AnalyticsEvents.ts Bestand weergeven

@@ -74,18 +74,6 @@ export enum AnalyticsEvents {
74 74
      */
75 75
     ACTION_JINGLE_TERMINATE = 'terminate',
76 76
 
77
-    /**
78
-     * The "action" value for Jingle events which indicates that a transport-replace
79
-     * was received.
80
-     */
81
-    ACTION_JINGLE_TR_RECEIVED = 'transport-replace.received',
82
-
83
-    /**
84
-     * The "action" value for Jingle events which indicates that a transport-replace
85
-     * succeeded (TODO: verify/fix the documentation)
86
-     */
87
-    ACTION_JINGLE_TR_SUCCESS = 'transport-replace.success',
88
-
89 77
     /**
90 78
      * The "action" value for P2P events which indicates that P2P session initiate message has been rejected by the client
91 79
      * because the mandatory requirements were not met.
@@ -233,8 +221,6 @@ export const ACTION_JINGLE_SA_TIMEOUT = AnalyticsEvents.ACTION_JINGLE_SA_TIMEOUT
233 221
 export const ACTION_JINGLE_SI_RECEIVED = AnalyticsEvents.ACTION_JINGLE_SI_RECEIVED;
234 222
 export const ACTION_JINGLE_SI_TIMEOUT = AnalyticsEvents.ACTION_JINGLE_SI_TIMEOUT;
235 223
 export const ACTION_JINGLE_TERMINATE = AnalyticsEvents.ACTION_JINGLE_TERMINATE;
236
-export const ACTION_JINGLE_TR_RECEIVED = AnalyticsEvents.ACTION_JINGLE_TR_RECEIVED;
237
-export const ACTION_JINGLE_TR_SUCCESS = AnalyticsEvents.ACTION_JINGLE_TR_SUCCESS;
238 224
 export const ACTION_P2P_DECLINED = AnalyticsEvents.ACTION_P2P_DECLINED;
239 225
 export const ACTION_P2P_ESTABLISHED = AnalyticsEvents.ACTION_P2P_ESTABLISHED;
240 226
 export const ACTION_P2P_FAILED = AnalyticsEvents.ACTION_P2P_FAILED;

+ 0
- 2
service/xmpp/XMPPEvents.spec.ts Bestand weergeven

@@ -36,8 +36,6 @@ describe( "/service/xmpp/XMPPEvents members", () => {
36 36
         expect( XMPPEvents.FOCUS_DISCONNECTED ).toBe( 'xmpp.focus_disconnected' );
37 37
         expect( XMPPEvents.FOCUS_LEFT ).toBe( 'xmpp.focus_left' );
38 38
         expect( XMPPEvents.GRACEFUL_SHUTDOWN ).toBe( 'xmpp.graceful_shutdown' );
39
-        expect( XMPPEvents.ICE_RESTARTING ).toBe( 'rtc.ice_restarting' );
40
-        expect( XMPPEvents.ICE_RESTART_SUCCESS ).toBe( 'rtc.ice_restart_success' );
41 39
         expect( XMPPEvents.KICKED ).toBe( 'xmpp.kicked' );
42 40
         expect( XMPPEvents.LOCAL_ROLE_CHANGED ).toBe( 'xmpp.localrole_changed' );
43 41
         expect( XMPPEvents.MEETING_ID_SET ).toBe( 'xmpp.meeting_id_set' );

+ 0
- 12
service/xmpp/XMPPEvents.ts Bestand weergeven

@@ -87,18 +87,6 @@ export enum XMPPEvents {
87 87
     FOCUS_LEFT = 'xmpp.focus_left',
88 88
     GRACEFUL_SHUTDOWN = 'xmpp.graceful_shutdown',
89 89
 
90
-    /**
91
-     * Event fired when 'transport-replace' Jingle message has been received,
92
-     * before the new offer is set on the PeerConnection.
93
-     */
94
-    ICE_RESTARTING = 'rtc.ice_restarting',
95
-
96
-    /**
97
-     * Event fired after the 'transport-replace' message has been processed
98
-     * and the new offer has been set successfully.
99
-     */
100
-    ICE_RESTART_SUCCESS = 'rtc.ice_restart_success',
101
-
102 90
     /**
103 91
      * Designates an event indicating that we were kicked from the XMPP MUC.
104 92
      * @param {boolean} isSelfPresence - whether it is for local participant

+ 0
- 1
types/hand-crafted/JitsiConference.d.ts Bestand weergeven

@@ -14,7 +14,6 @@ export default class JitsiConference {
14 14
     name: string;
15 15
     config: {
16 16
       avgRtpStatsN?: number,
17
-      enableIceRestart?: boolean,
18 17
       p2p?: {
19 18
         enabled: boolean,
20 19
         backToP2PDelay?: number

+ 0
- 1
types/hand-crafted/modules/xmpp/ChatRoom.d.ts Bestand weergeven

@@ -21,7 +21,6 @@ export default class ChatRoom extends Listenable {
21 21
   onConnStatusChanged: ( status: Strophe.Status ) => void;
22 22
   onPresence: ( pres: unknown ) => void; // TODO:
23 23
   setParticipantPropertyListener: ( listener: unknown ) => void; // TODO:
24
-  supportsRestartByTerminate: () => boolean;
25 24
   processNode: ( node: unknown, from: unknown ) => void; // TODO:
26 25
   sendMessage: ( message: unknown, elementName: string ) => void; // TODO:
27 26
   sendPrivateMessage: ( id: unknown, message: unknown, elementName: string ) => void; // TODO:

+ 0
- 4
types/hand-crafted/modules/xmpp/JingleSessionPC.d.ts Bestand weergeven

@@ -11,7 +11,6 @@ export default class JingleSessionPC extends JingleSession {
11 11
   getRemoteRecvMaxFrameHeight: () => number | undefined;
12 12
   sendIceCandidate: ( candidate: RTCIceCandidate ) => void;
13 13
   sendIceCandidates: ( candidates: RTCIceCandidate[] ) => void;
14
-  sendIceFailedNotification: () => void;
15 14
   addIceCandidates: ( elem: unknown ) => void; // TODO:
16 15
   readSsrcInfo: ( contents: unknown ) => void; // TODO:
17 16
   getConfiguredVideoCodec: () => CodecMimeType;
@@ -21,12 +20,9 @@ export default class JingleSessionPC extends JingleSession {
21 20
   setAnswer: ( jingleAnswer: unknown ) => void; // TODO:
22 21
   setOfferAnswerCycle: ( jingleOfferAnswerIq: JQuery, success: ( params: unknown ) => unknown, failure: ( params: unknown ) => unknown, localTracks?: JitsiLocalTrack[] ) => void; // TODO:
23 22
   setVideoCodecs: ( preferred?: CodecMimeType, disabled?: CodecMimeType ) => void;
24
-  replaceTransport: ( jingleOfferElem: unknown, success: ( params: unknown ) => unknown, failure: ( params: unknown ) => unknown ) => void; // TODO:
25 23
   sendSessionAccept: ( success: ( params: unknown ) => unknown, failure: ( params: unknown ) => unknown ) => void; // TODO:
26 24
   sendContentModify: () => void;
27 25
   setReceiverVideoConstraint: ( maxFrameHeight: number ) => void;
28
-  sendTransportAccept: ( localSDP: unknown, success: ( params: unknown ) => unknown, failure: ( params: unknown ) => unknown ) => void; // TODO:
29
-  sendTransportReject: ( success: ( params: unknown ) => unknown, failure: ( params: unknown ) => unknown ) => void; // TODO:
30 26
   setSenderMaxBitrates: () => Promise<void>;
31 27
   setSenderVideoConstraint: ( maxFrameHeight: number ) => Promise<unknown>; // TODO:
32 28
   setSenderVideoDegradationPreference: () => Promise<void>;

+ 0
- 2
types/hand-crafted/service/statistics/AnalyticsEvents.d.ts Bestand weergeven

@@ -10,8 +10,6 @@ export enum AnalyticsEvents {
10 10
   ACTION_JINGLE_SI_RECEIVED = 'session-initiate.received',
11 11
   ACTION_JINGLE_SI_TIMEOUT = 'session-initiate.timeout',
12 12
   ACTION_JINGLE_TERMINATE = 'terminate',
13
-  ACTION_JINGLE_TR_RECEIVED = 'transport-replace.received',
14
-  ACTION_JINGLE_TR_SUCCESS = 'transport-replace.success',
15 13
   ACTION_P2P_DECLINED = 'decline',
16 14
   ACTION_P2P_ESTABLISHED = 'established',
17 15
   ACTION_P2P_FAILED = 'failed',

+ 0
- 2
types/hand-crafted/service/xmpp/XMPPEvents.d.ts Bestand weergeven

@@ -23,8 +23,6 @@
23 23
   FOCUS_DISCONNECTED = 'xmpp.focus_disconnected',
24 24
   FOCUS_LEFT = 'xmpp.focus_left',
25 25
   GRACEFUL_SHUTDOWN = 'xmpp.graceful_shutdown',
26
-  ICE_RESTARTING = 'rtc.ice_restarting',
27
-  ICE_RESTART_SUCCESS = 'rtc.ice_restart_success',
28 26
   KICKED = 'xmpp.kicked',
29 27
   LOCAL_ROLE_CHANGED = 'xmpp.localrole_changed',
30 28
   MEETING_ID_SET = 'xmpp.meeting_id_set',

Laden…
Annuleren
Opslaan