Pārlūkot izejas kodu

fix: Always query the main domain for features. Fixes jitsi/jitsi-meet#8173 (#1428)

* fix: Always query the main domain for features.

* squash: Always use the main domain for turn credentials and ping.

* squash: Fix tests.
dev1
Дамян Минков 4 gadus atpakaļ
vecāks
revīzija
968f947627
Revīzijas autora e-pasta adrese nav piesaistīta nevienam kontam

+ 2
- 1
modules/xmpp/XmppConnection.js Parādīt failu

51
         super();
51
         super();
52
         this._options = {
52
         this._options = {
53
             enableWebsocketResume: typeof enableWebsocketResume === 'undefined' ? true : enableWebsocketResume,
53
             enableWebsocketResume: typeof enableWebsocketResume === 'undefined' ? true : enableWebsocketResume,
54
+            pingOptions: xmppPing,
54
             websocketKeepAlive: typeof websocketKeepAlive === 'undefined' ? 4 * 60 * 1000 : Number(websocketKeepAlive)
55
             websocketKeepAlive: typeof websocketKeepAlive === 'undefined' ? 4 * 60 * 1000 : Number(websocketKeepAlive)
55
         };
56
         };
56
 
57
 
255
             this._maybeStartWSKeepAlive();
256
             this._maybeStartWSKeepAlive();
256
             this._processDeferredIQs();
257
             this._processDeferredIQs();
257
             this._resumeTask.cancel();
258
             this._resumeTask.cancel();
258
-            this.ping.startInterval(this.domain);
259
+            this.ping.startInterval(this._options.pingOptions?.domain || this.domain);
259
         } else if (status === Strophe.Status.DISCONNECTED) {
260
         } else if (status === Strophe.Status.DISCONNECTED) {
260
             this.ping.stopInterval();
261
             this.ping.stopInterval();
261
 
262
 

+ 1
- 1
modules/xmpp/strophe.jingle.js Parādīt failu

305
         //      https://code.google.com/p/webrtc/issues/detail?id=1650
305
         //      https://code.google.com/p/webrtc/issues/detail?id=1650
306
         this.connection.sendIQ(
306
         this.connection.sendIQ(
307
             $iq({ type: 'get',
307
             $iq({ type: 'get',
308
-                to: this.connection.domain })
308
+                to: this.xmpp.options.hosts.domain })
309
                 .c('services', { xmlns: 'urn:xmpp:extdisco:1' }),
309
                 .c('services', { xmlns: 'urn:xmpp:extdisco:1' }),
310
             res => {
310
             res => {
311
                 const iceservers = [];
311
                 const iceservers = [];

+ 10
- 8
modules/xmpp/xmpp.js Parādīt failu

106
 
106
 
107
         initStropheNativePlugins();
107
         initStropheNativePlugins();
108
 
108
 
109
+        const xmppPing = options.xmppPing || {};
110
+
111
+        // let's ping the main domain (in case a guest one is used for the connection)
112
+        xmppPing.domain = options.hosts.domain;
113
+
109
         this.connection = createConnection({
114
         this.connection = createConnection({
110
             enableWebsocketResume: options.enableWebsocketResume,
115
             enableWebsocketResume: options.enableWebsocketResume,
111
 
116
 
113
             serviceUrl: options.serviceUrl || options.bosh,
118
             serviceUrl: options.serviceUrl || options.bosh,
114
             token,
119
             token,
115
             websocketKeepAlive: options.websocketKeepAlive,
120
             websocketKeepAlive: options.websocketKeepAlive,
116
-            xmppPing: options.xmppPing
121
+            xmppPing
117
         });
122
         });
118
 
123
 
119
         this._initStrophePlugins();
124
         this._initStrophePlugins();
227
             // XmppConnection emits CONNECTED again on reconnect - a good opportunity to clear any "last error" flags
232
             // XmppConnection emits CONNECTED again on reconnect - a good opportunity to clear any "last error" flags
228
             this._resetState();
233
             this._resetState();
229
 
234
 
230
-            // Schedule ping ?
231
-            const pingJid = this.connection.domain;
232
-
233
             // FIXME no need to do it again on stream resume
235
             // FIXME no need to do it again on stream resume
234
-            this.caps.getFeaturesAndIdentities(pingJid)
236
+            this.caps.getFeaturesAndIdentities(this.options.hosts.domain)
235
                 .then(({ features, identities }) => {
237
                 .then(({ features, identities }) => {
236
                     if (!features.has(Strophe.NS.PING)) {
238
                     if (!features.has(Strophe.NS.PING)) {
237
-                        logger.error(
238
-                            `Ping NOT supported by ${pingJid} - please enable ping in your XMPP server config`);
239
+                        logger.error(`Ping NOT supported by ${
240
+                            this.options.hosts.domain} - please enable ping in your XMPP server config`);
239
                     }
241
                     }
240
 
242
 
241
                     // check for speakerstats
243
                     // check for speakerstats
539
     ping(timeout) {
541
     ping(timeout) {
540
         return new Promise((resolve, reject) => {
542
         return new Promise((resolve, reject) => {
541
             this.connection.ping
543
             this.connection.ping
542
-                    .ping(this.connection.domain, resolve, reject, timeout);
544
+                    .ping(this.connection.options.hosts.domain, resolve, reject, timeout);
543
         });
545
         });
544
     }
546
     }
545
 
547
 

Notiek ielāde…
Atcelt
Saglabāt