|
|
@@ -130,11 +130,14 @@ Statistics.init = function(options) {
|
|
130
|
130
|
* callstats.
|
|
131
|
131
|
* @property {string} callStatsAliasName - The alias name to use when
|
|
132
|
132
|
* initializing callstats.
|
|
|
133
|
+ * @property {string} callStatsConfIDNamespace - A namespace to prepend the
|
|
|
134
|
+ * callstats conference ID with.
|
|
133
|
135
|
* @property {string} confID - The callstats conference ID to use.
|
|
134
|
136
|
* @property {string} callStatsID - Callstats credentials - the id.
|
|
135
|
137
|
* @property {string} callStatsSecret - Callstats credentials - the secret.
|
|
136
|
138
|
* @property {string} customScriptUrl - A custom lib url to use when downloading
|
|
137
|
139
|
* callstats library.
|
|
|
140
|
+ * @property {string} roomName - The room name we are currently in.
|
|
138
|
141
|
* @property {boolean} swapUserNameAndAlias - Whether to swap the places of
|
|
139
|
142
|
* username and alias when initiating callstats.
|
|
140
|
143
|
*/
|
|
|
@@ -172,6 +175,10 @@ export default function Statistics(xmpp, options) {
|
|
172
|
175
|
if (!this.options.confID) {
|
|
173
|
176
|
logger.warn('"confID" is not defined');
|
|
174
|
177
|
}
|
|
|
178
|
+
|
|
|
179
|
+ if (!this.options.callStatsConfIDNamespace) {
|
|
|
180
|
+ logger.warn('"callStatsConfIDNamespace" is not defined');
|
|
|
181
|
+ }
|
|
175
|
182
|
}
|
|
176
|
183
|
|
|
177
|
184
|
/**
|
|
|
@@ -367,7 +374,7 @@ Statistics.prototype.startCallStats = function(tpc, remoteUserID) {
|
|
367
|
374
|
= new CallStats(
|
|
368
|
375
|
tpc,
|
|
369
|
376
|
{
|
|
370
|
|
- confID: this.options.confID,
|
|
|
377
|
+ confID: this._getCallStatsConfID(),
|
|
371
|
378
|
remoteUserID
|
|
372
|
379
|
});
|
|
373
|
380
|
|
|
|
@@ -392,6 +399,19 @@ Statistics._getAllCallStatsInstances = function() {
|
|
392
|
399
|
return csInstances;
|
|
393
|
400
|
};
|
|
394
|
401
|
|
|
|
402
|
+/**
|
|
|
403
|
+ * Constructs the CallStats conference ID based on the options currently
|
|
|
404
|
+ * configured in this instance.
|
|
|
405
|
+ * @return {string}
|
|
|
406
|
+ * @private
|
|
|
407
|
+ */
|
|
|
408
|
+Statistics.prototype._getCallStatsConfID = function() {
|
|
|
409
|
+ // The conference ID is case sensitive!!!
|
|
|
410
|
+ return this.options.callStatsConfIDNamespace
|
|
|
411
|
+ ? `${this.options.callStatsConfIDNamespace}/${this.options.roomName}`
|
|
|
412
|
+ : this.options.roomName;
|
|
|
413
|
+};
|
|
|
414
|
+
|
|
395
|
415
|
/**
|
|
396
|
416
|
* Removes the callstats.io instances.
|
|
397
|
417
|
*/
|
|
|
@@ -683,7 +703,7 @@ Statistics.prototype.sendFeedback = function(overall, comment) {
|
|
683
|
703
|
comment
|
|
684
|
704
|
});
|
|
685
|
705
|
|
|
686
|
|
- return CallStats.sendFeedback(this.options.confID, overall, comment);
|
|
|
706
|
+ return CallStats.sendFeedback(this._getCallStatsConfID(), overall, comment);
|
|
687
|
707
|
};
|
|
688
|
708
|
|
|
689
|
709
|
Statistics.LOCAL_JID = require('../../service/statistics/constants').LOCAL_JID;
|