feat(log): Logs server field from jwt token

pull/953/head
hristoterezov 8 years ago
parent 8f4b94f732
commit fcc9532bde
  1. 5
      app.js
  2. 15
      conference.js
  3. 1
      modules/TokenData/TokenData.js

@ -110,6 +110,11 @@ function init() {
var isUIReady = APP.UI.start();
if (isUIReady) {
APP.conference.init({roomName: buildRoomName()}).then(function () {
let server = APP.tokenData.server;
if(server) {
APP.conference.logEvent("server." + server, 1);
}
APP.UI.initConference();
APP.UI.addListener(UIEvents.LANG_CHANGED, function (language) {

@ -1766,5 +1766,20 @@ export default {
// Update the view
APP.UI.setLocalRaisedHandStatus(raisedHand);
}
},
/**
* Log event to callstats and analytics.
* @param {string} name the event name
* @param {int} value the value (it's int because google analytics supports
* only int).
* NOTE: Should be used after conference.init
*/
logEvent(name, value) {
if(JitsiMeetJS.analytics) {
JitsiMeetJS.analytics.sendEvent(name, value);
}
if(room) {
room.sendApplicationLog(JSON.stringify({name, value}));
}
}
};

@ -97,6 +97,7 @@ class TokenData{
this.payload = this.decodedJWT.payload;
if(!this.payload.context)
return;
this.server = this.payload.context.server;
let callerData = this.payload.context.user;
let calleeData = this.payload.context.callee;
if(callerData)

Loading…
Cancel
Save