Selaa lähdekoodia

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

dev1
Gabriel Imre 5 vuotta sitten
vanhempi
commit
0a53da6add
4 muutettua tiedostoa jossa 7 lisäystä ja 4 poistoa
  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 Näytä tiedosto

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

+ 3
- 2
doc/API.md Näytä tiedosto

244
         - ignoreStartMuted - ignores start muted events coming from jicofo.
244
         - ignoreStartMuted - ignores start muted events coming from jicofo.
245
         - startSilent - enables silent mode, will mark audio as inactive will not send/receive audio
245
         - startSilent - enables silent mode, will mark audio as inactive will not send/receive audio
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.
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
         - statisticsId - The id to be used as stats instead of default callStatsUsername.
248
         - statisticsId - The id to be used as stats instead of default callStatsUsername.
248
         - statisticsDisplayName - The display name to be used for stats, used for callstats.
249
         - statisticsDisplayName - The display name to be used for stats, used for callstats.
249
 
250
 
448
 
449
 
449
 12. isEnded() - returns true if track is ended
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
     MediaStream which has the desired effect. "undefined" is passed to this function for removing the effect and for
454
     MediaStream which has the desired effect. "undefined" is passed to this function for removing the effect and for
454
-    
455
+
455
     restoring the original MediaStream on the JitsiTrack.
456
     restoring the original MediaStream on the JitsiTrack.
456
 
457
 
457
     The following methods have to be defined for the effect instance.
458
     The following methods have to be defined for the effect instance.

+ 1
- 1
modules/statistics/CallStats.js Näytä tiedosto

376
                 const match = options.confID.match(/.*\/(.*)\/.*/);
376
                 const match = options.confID.match(/.*\/(.*)\/.*/);
377
 
377
 
378
                 // if there is no tenant, we will just set '/'
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
             // userID is generated or given by the origin server
382
             // userID is generated or given by the origin server

+ 2
- 1
modules/statistics/statistics.js Näytä tiedosto

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

Loading…
Peruuta
Tallenna