Sfoglia il codice sorgente

feat(callstats): Add dedicated siteID parameter to allow for injection of jwt-based siteID

dev1
Gabriel Imre 5 anni fa
parent
commit
0a53da6add
4 ha cambiato i file con 7 aggiunte e 4 eliminazioni
  1. 1
    0
      JitsiConference.js
  2. 3
    2
      doc/API.md
  3. 1
    1
      modules/statistics/CallStats.js
  4. 2
    1
      modules/statistics/statistics.js

+ 1
- 0
JitsiConference.js Vedi File

@@ -376,6 +376,7 @@ JitsiConference.prototype._init = function(options = {}) {
376 376
             userName: config.statisticsDisplayName ? config.statisticsDisplayName : this.myUserId(),
377 377
             callStatsConfIDNamespace: this.connection.options.hosts.domain,
378 378
             confID: config.confID || `${this.connection.options.hosts.domain}/${this.options.name}`,
379
+            siteID: config.siteID,
379 380
             customScriptUrl: config.callStatsCustomScriptUrl,
380 381
             callStatsID: config.callStatsID,
381 382
             callStatsSecret: config.callStatsSecret,

+ 3
- 2
doc/API.md Vedi File

@@ -244,6 +244,7 @@ This objects represents the server connection. You can create new ```JitsiConnec
244 244
         - ignoreStartMuted - ignores start muted events coming from jicofo.
245 245
         - startSilent - enables silent mode, will mark audio as inactive will not send/receive audio
246 246
         - confID - Used for statistics to identify conference, if tenants are supported will contain tenant and the non lower case variant for the room name.
247
+        - siteID - (optional) Used for statistics to identify the site where the user is coming from, if tenants are supported it will contain a unique identifier for that tenant. If not provided, the value will be infered from confID
247 248
         - statisticsId - The id to be used as stats instead of default callStatsUsername.
248 249
         - statisticsDisplayName - The display name to be used for stats, used for callstats.
249 250
 
@@ -448,10 +449,10 @@ We have the following methods for controling the tracks:
448 449
 
449 450
 12. isEnded() - returns true if track is ended
450 451
 
451
-13. setEffect(effect) - Applies the effect by swapping out the existing MediaStream on the JitsiTrack with the new 
452
+13. setEffect(effect) - Applies the effect by swapping out the existing MediaStream on the JitsiTrack with the new
452 453
 
453 454
     MediaStream which has the desired effect. "undefined" is passed to this function for removing the effect and for
454
-    
455
+
455 456
     restoring the original MediaStream on the JitsiTrack.
456 457
 
457 458
     The following methods have to be defined for the effect instance.

+ 1
- 1
modules/statistics/CallStats.js Vedi File

@@ -376,7 +376,7 @@ export default class CallStats {
376 376
                 const match = options.confID.match(/.*\/(.*)\/.*/);
377 377
 
378 378
                 // if there is no tenant, we will just set '/'
379
-                configParams.siteID = (match && match[1]) || '/';
379
+                configParams.siteID = options.siteID || (match && match[1]) || '/';
380 380
             }
381 381
 
382 382
             // userID is generated or given by the origin server

+ 2
- 1
modules/statistics/statistics.js Vedi File

@@ -69,7 +69,8 @@ function _initCallStatsBackend(options) {
69 69
         aliasName: options.aliasName,
70 70
         applicationName: options.applicationName,
71 71
         getWiFiStatsMethod: options.getWiFiStatsMethod,
72
-        confID: options.confID
72
+        confID: options.confID,
73
+        siteID: options.siteID
73 74
     })) {
74 75
         logger.error('CallStats Backend initialization failed bad');
75 76
     }

Loading…
Annulla
Salva