Add callstats support

This commit is contained in:
hristoterezov 2016-01-22 11:33:32 -06:00
parent 9358f062ef
commit 175264b7f9
15 changed files with 9220 additions and 392 deletions

View File

@ -12,6 +12,7 @@ var JitsiParticipant = require("./JitsiParticipant");
var Statistics = require("./modules/statistics/statistics");
var JitsiDTMFManager = require('./modules/DTMF/JitsiDTMFManager');
var JitsiTrackEvents = require("./JitsiTrackEvents");
var Settings = require("./modules/settings/Settings");
/**
* Creates a JitsiConference object with the given name and properties.
@ -32,12 +33,22 @@ function JitsiConference(options) {
this.connection = this.options.connection;
this.xmpp = this.connection.xmpp;
this.eventEmitter = new EventEmitter();
this.room = this.xmpp.createRoom(this.options.name, this.options.config);
var confID = this.options.name + '@' + this.xmpp.options.hosts.muc;
this.settings = new Settings(confID);
this.room = this.xmpp.createRoom(this.options.name, this.options.config,
this.settings);
this.room.updateDeviceAvailability(RTC.getDeviceAvailability());
this.rtc = new RTC(this.room, options);
if(!RTC.options.disableAudioLevels)
this.statistics = new Statistics();
this.statistics = new Statistics({
disableAudioLevels: RTC.options.disableAudioLevels,
callStatsID: this.options.config.callStatsID,
callStatsSecret: this.options.config.callStatsSecret,
disableThirdPartyRequests: this.options.config.disableThirdPartyRequests
});
setupListeners(this);
JitsiMeetJS._gumFailedHandler.push(function(error) {
this.statistics.sendGetUserMediaFailed(error);
}.bind(this));
this.participants = {};
this.lastDominantSpeaker = null;
this.dtmfManager = null;
@ -259,9 +270,12 @@ JitsiConference.prototype.addTrack = function (track) {
track.muteHandler = this._fireMuteChangeEvent.bind(this, track);
track.stopHandler = this.removeTrack.bind(this, track);
track.audioLevelHandler = this._fireAudioLevelChangeEvent.bind(this);
track.addEventListener(JitsiTrackEvents.TRACK_MUTE_CHANGED, track.muteHandler);
track.addEventListener(JitsiTrackEvents.TRACK_STOPPED, track.stopHandler);
track.addEventListener(JitsiTrackEvents.TRACK_AUDIO_LEVEL_CHANGED, track.audioLevelHandler);
track.addEventListener(JitsiTrackEvents.TRACK_MUTE_CHANGED,
track.muteHandler);
track.addEventListener(JitsiTrackEvents.TRACK_STOPPED,
track.stopHandler);
track.addEventListener(JitsiTrackEvents.TRACK_AUDIO_LEVEL_CHANGED,
track.audioLevelHandler);
this.eventEmitter.emit(JitsiConferenceEvents.TRACK_ADDED, track);
}.bind(this));
};
@ -717,6 +731,29 @@ JitsiConference.prototype.getLogs = function () {
return data;
};
/**
* Sends the given feedback through CallStats if enabled.
*
* @param overallFeedback an integer between 1 and 5 indicating the
* user feedback
* @param detailedFeedback detailed feedback from the user. Not yet used
*/
JitsiConference.prototype.sendFeedback =
function(overallFeedback, detailedFeedback){
this.statistics.sendFeedback(overallFeedback, detailedFeedback);
}
/**
* Returns true if the callstats integration is enabled, otherwise returns
* false.
*
* @returns true if the callstats integration is enabled, otherwise returns
* false.
*/
JitsiConference.prototype.isCallstatsEnabled = function () {
return this.statistics.isCallstatsEnabled();
}
/**
* Setups the listeners needed for the conference.
* @param conference the conference
@ -724,8 +761,7 @@ JitsiConference.prototype.getLogs = function () {
function setupListeners(conference) {
conference.xmpp.addListener(XMPPEvents.CALL_INCOMING, function (event) {
conference.rtc.onIncommingCall(event);
if(conference.statistics)
conference.statistics.startRemoteStats(event.peerconnection);
conference.statistics.startRemoteStats(event.peerconnection);
});
conference.room.addListener(XMPPEvents.REMOTE_STREAM_RECEIVED,
@ -907,6 +943,51 @@ function setupListeners(conference) {
// RTC.addListener(RTCEvents.AVAILABLE_DEVICES_CHANGED, function (devices) {
// conference.room.updateDeviceAvailability(devices);
// });
conference.room.addListener(XMPPEvents.PEERCONNECTION_READY,
function (session) {
conference.statistics.startCallStats(
session, conference.settings);
});
conference.room.addListener(XMPPEvents.CONFERENCE_SETUP_FAILED,
function () {
conference.statistics.sendSetupFailedEvent();
});
conference.on(JitsiConferenceEvents.TRACK_MUTE_CHANGED,
function (track) {
if(!track.isLocal())
return;
var type = (track.getType() === "audio")? "audio" : "video";
conference.statistics.sendMuteEvent(track.isMuted(), type);
});
conference.room.addListener(XMPPEvents.CREATE_OFFER_FAILED, function (e, pc) {
conference.statistics.sendCreateOfferFailed(e, pc);
});
conference.room.addListener(XMPPEvents.CREATE_ANSWER_FAILED, function (e, pc) {
conference.statistics.sendCreateAnswerFailed(e, pc);
});
conference.room.addListener(XMPPEvents.SET_LOCAL_DESCRIPTION_FAILED,
function (e, pc) {
conference.statistics.sendSetLocalDescFailed(e, pc);
}
);
conference.room.addListener(XMPPEvents.SET_REMOTE_DESCRIPTION_FAILED,
function (e, pc) {
conference.statistics.sendSetRemoteDescFailed(e, pc);
}
);
conference.room.addListener(XMPPEvents.ADD_ICE_CANDIDATE_FAILED,
function (e, pc) {
conference.statistics.sendAddIceCandidateFailed(e, pc);
}
);
}
}

View File

@ -43,6 +43,10 @@ var LibJitsiMeet = {
track: JitsiTrackErrors
},
logLevels: Logger.levels,
/**
* Array of functions that will receive the GUM error.
*/
_gumFailedHandler: [],
init: function (options) {
return RTC.init(options || {});
},
@ -90,6 +94,10 @@ var LibJitsiMeet = {
}
return tracks;
}).catch(function (error) {
this._gumFailedHandler.forEach(function (handler) {
handler(error);
});
Statistics.sendGetUserMediaFailed(error);
if(error === JitsiTrackErrors.UNSUPPORTED_RESOLUTION) {
var oldResolution = options.resolution || '360';
var newResolution = getLowerResolution(oldResolution);
@ -99,7 +107,7 @@ var LibJitsiMeet = {
return LibJitsiMeet.createLocalTracks(options);
}
return Promise.reject(error);
});
}.bind(this));
},
/**
* Checks if its possible to enumerate available cameras/micropones.

File diff suppressed because it is too large Load Diff

28
lib-jitsi-meet.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -70,6 +70,4 @@ JitsiRemoteTrack.prototype.isLocal = function () {
delete JitsiRemoteTrack.prototype.stop;
delete JitsiRemoteTrack.prototype.start;
module.exports = JitsiRemoteTrack;

View File

@ -1,5 +1,7 @@
var logger = require("jitsi-meet-logger").getLogger(__filename);
var UsernameGenerator = require('../util/UsernameGenerator');
function supportsLocalStorage() {
try {
return 'localStorage' in window && window.localStorage !== null;
@ -22,6 +24,7 @@ function Settings(conferenceID) {
this.userId;
this.confSettings = null;
this.conferenceID = conferenceID;
this.callStatsUserName;
if (supportsLocalStorage()) {
if(!window.localStorage.getItem(conferenceID))
this.confSettings = {};
@ -33,11 +36,21 @@ function Settings(conferenceID) {
this.confSettings.jitsiMeetId);
this.save();
}
if (!this.confSettings.callStatsUserName) {
this.confSettings.callStatsUserName
= UsernameGenerator.generateUsername();
logger.log('generated callstats uid',
this.confSettings.callStatsUserName);
this.save();
}
this.userId = this.confSettings.jitsiMeetId || '';
this.displayName = this.confSettings.displayname || '';
this.callStatsUserName = this.confSettings.callStatsUserName || '';
} else {
logger.log("local storage is not supported");
this.userId = generateUniqueId();
this.callStatsUserName = UsernameGenerator.generateUsername();
}
}
@ -52,12 +65,21 @@ Settings.prototype.setDisplayName = function (newDisplayName) {
this.confSettings.displayname = displayName;
this.save();
return this.displayName;
},
}
Settings.prototype.getSettings = function () {
return {
displayName: this.displayName,
uid: this.userId
};
},
}
/**
* Returns fake username for callstats
* @returns {string} fake username for callstats
*/
Settings.prototype.getCallStatsUserName = function () {
return this.callStatsUserName;
}
module.exports = Settings;

View File

@ -1,79 +1,257 @@
/* global config, $, APP, Strophe, callstats */
/* global $, Strophe, callstats */
var logger = require("jitsi-meet-logger").getLogger(__filename);
var jsSHA = require('jssha');
var io = require('socket.io-client');
/**
* @const
* @see http://www.callstats.io/api/#enumeration-of-wrtcfuncnames
*/
var wrtcFuncNames = {
createOffer: "createOffer",
createAnswer: "createAnswer",
setLocalDescription: "setLocalDescription",
setRemoteDescription: "setRemoteDescription",
addIceCandidate: "addIceCandidate",
getUserMedia: "getUserMedia"
};
var callStats = null;
function initCallback (err, msg) {
logger.log("Initializing Status: err="+err+" msg="+msg);
logger.log("CallStats Status: err=" + err + " msg=" + msg);
}
var CallStats = {
init: function (jingleSession) {
/**
* Returns a function which invokes f in a try/catch block, logs any exception
* to the console, and then swallows it.
*
* @param f the function to invoke in a try/catch block
* @return a function which invokes f in a try/catch block, logs any exception
* to the console, and then swallows it
*/
function _try_catch (f) {
return function () {
try {
f.apply(this, arguments);
} catch (e) {
logger.error(e);
}
};
}
if(!config.callStatsID || !config.callStatsSecret || callStats !== null)
/**
* Creates new CallStats instance that handles all callstats API calls.
* @param peerConnection {JingleSessionPC} the session object
* @param Settings {Settings} the settings instance. Declared in
* /modules/settings/Settings.js
* @param options {object} credentials for callstats.
*/
var CallStats = _try_catch(function(jingleSession, Settings, options) {
try{
//check weather that should work with more than 1 peerconnection
if(!callStats) {
callStats = new callstats($, io, jsSHA);
} else {
return;
callStats = new callstats($, io, jsSHA);
}
this.session = jingleSession;
this.peerconnection = jingleSession.peerconnection.peerconnection;
this.userID = APP.xmpp.myResource();
this.userID = Settings.getCallStatsUserName();
//FIXME: change it to something else (maybe roomName)
var location = window.location;
this.confID = location.hostname + location.pathname;
//userID is generated or given by the origin server
callStats.initialize(config.callStatsID,
config.callStatsSecret,
callStats.initialize(options.callStatsID,
options.callStatsSecret,
this.userID,
initCallback);
var usage = callStats.fabricUsage.multiplex;
callStats.addNewFabric(this.peerconnection,
Strophe.getResourceFromJid(jingleSession.peerjid),
usage,
callStats.fabricUsage.multiplex,
this.confID,
this.pcCallback.bind(this));
},
pcCallback: function (err, msg) {
if (!callStats)
return;
logger.log("Monitoring status: "+ err + " msg: " + msg);
callStats.sendFabricEvent(this.peerconnection,
callStats.fabricEvent.fabricSetup, this.confID);
},
sendMuteEvent: function (mute, type) {
if (!callStats)
return;
var event = null;
if (type === "video") {
event = (mute? callStats.fabricEvent.videoPause :
callStats.fabricEvent.videoResume);
}
else {
event = (mute? callStats.fabricEvent.audioMute :
callStats.fabricEvent.audioUnmute);
}
callStats.sendFabricEvent(this.peerconnection, event, this.confID);
},
sendTerminateEvent: function () {
if(!callStats) {
return;
}
callStats.sendFabricEvent(this.peerconnection,
callStats.fabricEvent.fabricTerminated, this.confID);
},
sendSetupFailedEvent: function () {
if(!callStats) {
return;
}
callStats.sendFabricEvent(this.peerconnection,
callStats.fabricEvent.fabricSetupFailed, this.confID);
} catch (e) {
// The callstats.io API failed to initialize (e.g. because its
// download failed to succeed in general or on time). Further
// attempts to utilize it cannot possibly succeed.
callStats = null;
logger.error(e);
}
// notify callstats about failures if there were any
if (CallStats.pendingErrors.length) {
CallStats.pendingErrors.forEach(function (error) {
CallStats._reportError.call(this, error.type, error.error,
error.pc);
}, this);
CallStats.pendingErrors.length = 0;
}
});
// some errors may happen before CallStats init
// in this case we accumulate them in this array
// and send them to callstats on init
CallStats.pendingErrors = [];
CallStats.prototype.pcCallback = _try_catch(function (err, msg) {
if (!callStats) {
return;
}
logger.log("Monitoring status: "+ err + " msg: " + msg);
callStats.sendFabricEvent(this.peerconnection,
callStats.fabricEvent.fabricSetup, this.confID);
});
/**
* Notifies CallStats for mute events
* @param mute {boolean} true for muted and false for not muted
* @param type {String} "audio"/"video"
*/
CallStats.prototype.sendMuteEvent = _try_catch(function (mute, type) {
if (!callStats) {
return;
}
var event = null;
if (type === "video") {
event = (mute? callStats.fabricEvent.videoPause :
callStats.fabricEvent.videoResume);
}
else {
event = (mute? callStats.fabricEvent.audioMute :
callStats.fabricEvent.audioUnmute);
}
callStats.sendFabricEvent(this.peerconnection, event, this.confID);
});
/**
* Notifies CallStats for connection setup errors
*/
CallStats.prototype.sendTerminateEvent = _try_catch(function () {
if(!callStats) {
return;
}
callStats.sendFabricEvent(this.peerconnection,
callStats.fabricEvent.fabricTerminated, this.confID);
});
/**
* Notifies CallStats for connection setup errors
*/
CallStats.prototype.sendSetupFailedEvent = _try_catch(function () {
if(!callStats) {
return;
}
callStats.sendFabricEvent(this.peerconnection,
callStats.fabricEvent.fabricSetupFailed, this.confID);
});
/**
* Sends the given feedback through CallStats.
*
* @param overallFeedback an integer between 1 and 5 indicating the
* user feedback
* @param detailedFeedback detailed feedback from the user. Not yet used
*/
CallStats.prototype.sendFeedback = _try_catch(
function(overallFeedback, detailedFeedback) {
if(!callStats) {
return;
}
var feedbackString = '{"userID":"' + this.userID + '"' +
', "overall":' + overallFeedback +
', "comment": "' + detailedFeedback + '"}';
var feedbackJSON = JSON.parse(feedbackString);
callStats.sendUserFeedback(this.confID, feedbackJSON);
});
/**
* Reports an error to callstats.
*
* @param type the type of the error, which will be one of the wrtcFuncNames
* @param e the error
* @param pc the peerconnection
* @private
*/
CallStats._reportError = function (type, e, pc) {
if (callStats) {
callStats.reportError(pc, this.confID, type, e);
} else {
CallStats.pendingErrors.push({ type: type, error: e, pc: pc});
}
// else just ignore it
};
module.exports = CallStats;
/**
* Notifies CallStats that getUserMedia failed.
*
* @param {Error} e error to send
* @param {CallStats} cs callstats instance related to the error (optional)
*/
CallStats.sendGetUserMediaFailed = _try_catch(function (e, cs) {
CallStats._reportError.call(cs, wrtcFuncNames.getUserMedia, e, null);
});
/**
* Notifies CallStats that peer connection failed to create offer.
*
* @param {Error} e error to send
* @param {RTCPeerConnection} pc connection on which failure occured.
* @param {CallStats} cs callstats instance related to the error (optional)
*/
CallStats.sendCreateOfferFailed = _try_catch(function (e, pc, cs) {
CallStats._reportError.call(cs, wrtcFuncNames.createOffer, e, pc);
});
/**
* Notifies CallStats that peer connection failed to create answer.
*
* @param {Error} e error to send
* @param {RTCPeerConnection} pc connection on which failure occured.
* @param {CallStats} cs callstats instance related to the error (optional)
*/
CallStats.sendCreateAnswerFailed = _try_catch(function (e, pc, cs) {
CallStats._reportError.call(cs, wrtcFuncNames.createAnswer, e, pc);
});
/**
* Notifies CallStats that peer connection failed to set local description.
*
* @param {Error} e error to send
* @param {RTCPeerConnection} pc connection on which failure occured.
* @param {CallStats} cs callstats instance related to the error (optional)
*/
CallStats.sendSetLocalDescFailed = _try_catch(function (e, pc, cs) {
CallStats._reportError.call(cs, wrtcFuncNames.setLocalDescription, e, pc);
});
/**
* Notifies CallStats that peer connection failed to set remote description.
*
* @param {Error} e error to send
* @param {RTCPeerConnection} pc connection on which failure occured.
* @param {CallStats} cs callstats instance related to the error (optional)
*/
CallStats.sendSetRemoteDescFailed = _try_catch(function (e, pc, cs) {
CallStats._reportError.call(cs, wrtcFuncNames.setRemoteDescription, e, pc);
});
/**
* Notifies CallStats that peer connection failed to add ICE candidate.
*
* @param {Error} e error to send
* @param {RTCPeerConnection} pc connection on which failure occured.
* @param {CallStats} cs callstats instance related to the error (optional)
*/
CallStats.sendAddIceCandidateFailed = _try_catch(function (e, pc, cs) {
CallStats._reportError.call(cs, wrtcFuncNames.addIceCandidate, e, pc);
});
module.exports = CallStats;

View File

@ -3,29 +3,51 @@ var LocalStats = require("./LocalStatsCollector.js");
var RTPStats = require("./RTPStatsCollector.js");
var EventEmitter = require("events");
var StatisticsEvents = require("../../service/statistics/Events");
//var StreamEventTypes = require("../../service/RTC/StreamEventTypes.js");
//var XMPPEvents = require("../../service/xmpp/XMPPEvents");
//var CallStats = require("./CallStats");
//var RTCEvents = require("../../service/RTC/RTCEvents");
var CallStats = require("./CallStats");
//
//function onDisposeConference(onUnload) {
// CallStats.sendTerminateEvent();
// stopRemote();
// if(onUnload) {
// stopLocal();
// eventEmitter.removeAllListeners();
// }
//}
// Since callstats.io is a third party, we cannot guarantee the quality of
// their service. More specifically, their server may take noticeably long
// time to respond. Consequently, it is in our best interest (in the sense
// that the intergration of callstats.io is pretty important to us but not
// enough to allow it to prevent people from joining a conference) to (1)
// start downloading their API as soon as possible and (2) do the
// downloading asynchronously.
function loadCallStatsAPI() {
(function (d, src) {
var elementName = 'script';
var newScript = d.createElement(elementName);
var referenceNode = d.getElementsByTagName(elementName)[0];
newScript.async = true;
newScript.src = src;
referenceNode.parentNode.insertBefore(newScript, referenceNode);
})(document, 'https://api.callstats.io/static/callstats.min.js');
// FIXME At the time of this writing, we hope that the callstats.io API will
// have loaded by the time we needed it (i.e. CallStats.init is invoked).
}
var eventEmitter = new EventEmitter();
function Statistics() {
function Statistics(options) {
this.rtpStats = null;
this.eventEmitter = new EventEmitter();
this.options = options || {};
this.callStatsIntegrationEnabled
= this.options.callStatsID && this.options.callStatsSecret
// Even though AppID and AppSecret may be specified, the integration of
// callstats.io may be disabled because of globally-disallowed requests
// to any third parties.
&& (this.options.disableThirdPartyRequests !== true);
if(this.callStatsIntegrationEnabled)
loadCallStatsAPI();
this.audioLevelsEnabled = !this.disableAudioLevels || true;
this.callStats = null;
}
Statistics.prototype.startRemoteStats = function (peerconnection) {
if(!this.audioLevelsEnabled)
return;
if (this.rtpStats) {
this.rtpStats.stop();
}
@ -37,6 +59,8 @@ Statistics.prototype.startRemoteStats = function (peerconnection) {
Statistics.localStats = [];
Statistics.startLocalStats = function (stream, callback) {
if(!this.audioLevelsEnabled)
return;
var localStats = new LocalStats(stream, 200, callback);
this.localStats.push(localStats);
localStats.start();
@ -44,32 +68,50 @@ Statistics.startLocalStats = function (stream, callback) {
Statistics.prototype.addAudioLevelListener = function(listener)
{
if(!this.audioLevelsEnabled)
return;
this.eventEmitter.on(StatisticsEvents.AUDIO_LEVEL, listener);
}
Statistics.prototype.removeAudioLevelListener = function(listener)
{
if(!this.audioLevelsEnabled)
return;
this.eventEmitter.removeListener(StatisticsEvents.AUDIO_LEVEL, listener);
}
Statistics.prototype.dispose = function () {
Statistics.stopAllLocalStats();
this.stopRemote();
if(this.eventEmitter)
this.eventEmitter.removeAllListeners();
if(this.audioLevelsEnabled) {
Statistics.stopAllLocalStats();
this.stopRemote();
if(this.eventEmitter)
this.eventEmitter.removeAllListeners();
if(eventEmitter)
eventEmitter.removeAllListeners();
if(eventEmitter)
eventEmitter.removeAllListeners();
}
if(this.callstats)
{
this.callstats.sendTerminateEvent();
this.callstats = null;
}
}
Statistics.stopAllLocalStats = function () {
if(!this.audioLevelsEnabled)
return;
for(var i = 0; i < this.localStats.length; i++)
this.localStats[i].stop();
this.localStats = [];
}
Statistics.stopLocalStats = function (stream) {
if(!this.audioLevelsEnabled)
return;
for(var i = 0; i < Statistics.localStats.length; i++)
if(Statistics.localStats[i].stream === stream){
var localStats = Statistics.localStats.splice(i, 1);
@ -79,7 +121,7 @@ Statistics.stopLocalStats = function (stream) {
}
Statistics.prototype.stopRemote = function () {
if (this.rtpStats) {
if (this.rtpStats && this.audioLevelsEnabled) {
this.rtpStats.stop();
this.eventEmitter.emit(StatisticsEvents.STOP);
this.rtpStats = null;
@ -97,77 +139,144 @@ Statistics.prototype.stopRemote = function () {
* at this time.
*/
Statistics.prototype.getPeerSSRCAudioLevel = function (peerJid, ssrc) {
if(!this.audioLevelsEnabled)
return;
var peerStats = this.rtpStats.jid2stats[peerJid];
return peerStats ? peerStats.ssrc2AudioLevel[ssrc] : null;
};
//CALSTATS METHODS
/**
* Initializes the callstats.io API.
* @param peerConnection {JingleSessionPC} the session object
* @param Settings {Settings} the settings instance. Declared in
* /modules/settings/Settings.js
*/
Statistics.prototype.startCallStats = function (session, settings) {
if(this.callStatsIntegrationEnabled) {
this.callstats = new CallStats(session, settings, this.options);
}
}
/**
* Returns true if the callstats integration is enabled, otherwise returns
* false.
*
* @returns true if the callstats integration is enabled, otherwise returns
* false.
*/
Statistics.prototype.isCallstatsEnabled = function () {
return this.callStatsIntegrationEnabled;
}
/**
* Notifies CallStats for connection setup errors
*/
Statistics.prototype.sendSetupFailedEvent = function () {
if(this.callStatsIntegrationEnabled && this.callstats)
this.callstats.sendSetupFailedEvent();
}
/**
* Notifies CallStats for mute events
* @param mute {boolean} true for muted and false for not muted
* @param type {String} "audio"/"video"
*/
Statistics.prototype.sendMuteEvent = function (muted, type) {
if(this.callStatsIntegrationEnabled && this.callstats)
this.callstats.sendMuteEvent(muted, type);
}
/**
* Notifies CallStats that getUserMedia failed.
*
* @param {Error} e error to send
*/
Statistics.prototype.sendGetUserMediaFailed = function (e) {
if(this.callStatsIntegrationEnabled)
CallStats.sendGetUserMediaFailed(e, this.callstats);
};
/**
* Notifies CallStats that getUserMedia failed.
*
* @param {Error} e error to send
*/
Statistics.sendGetUserMediaFailed = function (e) {
CallStats.sendGetUserMediaFailed(e, null);
};
/**
* Notifies CallStats that peer connection failed to create offer.
*
* @param {Error} e error to send
* @param {RTCPeerConnection} pc connection on which failure occured.
*/
Statistics.prototype.sendCreateOfferFailed = function (e, pc) {
if(this.callStatsIntegrationEnabled)
CallStats.sendCreateOfferFailed(e, pc, this.callstats);
};
/**
* Notifies CallStats that peer connection failed to create answer.
*
* @param {Error} e error to send
* @param {RTCPeerConnection} pc connection on which failure occured.
*/
Statistics.prototype.sendCreateAnswerFailed = function (e, pc) {
if(this.callStatsIntegrationEnabled)
CallStats.sendCreateAnswerFailed(e, pc, this.callstats);
};
/**
* Notifies CallStats that peer connection failed to set local description.
*
* @param {Error} e error to send
* @param {RTCPeerConnection} pc connection on which failure occured.
*/
Statistics.prototype.sendSetLocalDescFailed = function (e, pc) {
if(this.callStatsIntegrationEnabled)
CallStats.sendSetLocalDescFailed(e, pc, this.callstats);
}
/**
* Notifies CallStats that peer connection failed to set remote description.
*
* @param {Error} e error to send
* @param {RTCPeerConnection} pc connection on which failure occured.
*/
Statistics.prototype.sendSetRemoteDescFailed = function (e, pc) {
if(this.callStatsIntegrationEnabled)
CallStats.sendSetRemoteDescFailed(e, pc, this.callstats);
}
/**
* Notifies CallStats that peer connection failed to add ICE candidate.
*
* @param {Error} e error to send
* @param {RTCPeerConnection} pc connection on which failure occured.
*/
Statistics.prototype.sendAddIceCandidateFailed = function (e, pc) {
if(this.callStatsIntegrationEnabled)
CallStats.sendAddIceCandidateFailed(e, pc, this.callstats);
}
/**
* Sends the given feedback through CallStats.
*
* @param overallFeedback an integer between 1 and 5 indicating the
* user feedback
* @param detailedFeedback detailed feedback from the user. Not yet used
*/
Statistics.prototype.sendFeedback =
function(overallFeedback, detailedFeedback){
if(this.callStatsIntegrationEnabled && this.callstats)
this.callstats.sendFeedback(overallFeedback, detailedFeedback);
}
Statistics.LOCAL_JID = require("../../service/statistics/constants").LOCAL_JID;
//
//var statistics = {
// /**
// * Indicates that this audio level is for local jid.
// * @type {string}
// */
// LOCAL_JID: 'local',
//
// addConnectionStatsListener: function(listener)
// {
// eventEmitter.on("statistics.connectionstats", listener);
// },
//
// removeConnectionStatsListener: function(listener)
// {
// eventEmitter.removeListener("statistics.connectionstats", listener);
// },
//
//
// addRemoteStatsStopListener: function(listener)
// {
// eventEmitter.on("statistics.stop", listener);
// },
//
// removeRemoteStatsStopListener: function(listener)
// {
// eventEmitter.removeListener("statistics.stop", listener);
// },
//
//
// stopRemoteStatistics: function()
// {
// stopRemote();
// },
//
//// Already implemented with the constructor
// start: function () {
// APP.RTC.addStreamListener(onStreamCreated,
// StreamEventTypes.EVENT_TYPE_LOCAL_CREATED);
// APP.xmpp.addListener(XMPPEvents.DISPOSE_CONFERENCE, onDisposeConference);
// //FIXME: we may want to change CALL INCOMING event to onnegotiationneeded
// APP.xmpp.addListener(XMPPEvents.CALL_INCOMING, function (event) {
// startRemoteStats(event.peerconnection);
//// CallStats.init(event);
// });
//// APP.xmpp.addListener(XMPPEvents.PEERCONNECTION_READY, function (session) {
//// CallStats.init(session);
//// });
// //FIXME: that event is changed to TRACK_MUTE_CHANGED
//// APP.RTC.addListener(RTCEvents.AUDIO_MUTE, function (mute) {
//// CallStats.sendMuteEvent(mute, "audio");
//// });
//// APP.xmpp.addListener(XMPPEvents.CONFERENCE_SETUP_FAILED, function () {
//// CallStats.sendSetupFailedEvent();
//// });
// //FIXME: that event is changed to TRACK_MUTE_CHANGED
//// APP.RTC.addListener(RTCEvents.VIDEO_MUTE, function (mute) {
//// CallStats.sendMuteEvent(mute, "video");
//// });
// }
//};
module.exports = Statistics;

View File

@ -0,0 +1,429 @@
var RandomUtil = require('./RandomUtil');
/**
* from faker.js - Copyright (c) 2014-2015 Matthew Bergman & Marak Squires
* MIT License
* http://github.com/marak/faker.js/
*
* @const
*/
var names = [
"Aaliyah", "Aaron", "Abagail", "Abbey", "Abbie", "Abbigail",
"Abby", "Abdiel", "Abdul", "Abdullah", "Abe", "Abel", "Abelardo", "Abigail",
"Abigale", "Abigayle", "Abner", "Abraham", "Ada", "Adah", "Adalberto",
"Adaline", "Adam", "Adan", "Addie", "Addison", "Adela", "Adelbert", "Adele",
"Adelia", "Adeline", "Adell", "Adella", "Adelle", "Aditya", "Adolf", "Adolfo",
"Adolph", "Adolphus", "Adonis", "Adrain", "Adrian", "Adriana", "Adrianna",
"Adriel", "Adrien", "Adrienne", "Afton", "Aglae", "Agnes", "Agustin",
"Agustina", "Ahmad", "Ahmed", "Aida", "Aidan", "Aiden", "Aileen", "Aimee",
"Aisha", "Aiyana", "Akeem", "Al", "Alaina", "Alan", "Alana", "Alanis",
"Alanna", "Alayna", "Alba", "Albert", "Alberta", "Albertha", "Alberto",
"Albin", "Albina", "Alda", "Alden", "Alec", "Aleen", "Alejandra",
"Alejandrin", "Alek", "Alena", "Alene", "Alessandra", "Alessandro", "Alessia",
"Aletha", "Alex", "Alexa", "Alexander", "Alexandra", "Alexandre",
"Alexandrea", "Alexandria", "Alexandrine", "Alexandro", "Alexane", "Alexanne",
"Alexie", "Alexis", "Alexys", "Alexzander", "Alf", "Alfonso", "Alfonzo",
"Alford", "Alfred", "Alfreda", "Alfredo", "Ali", "Alia", "Alice", "Alicia",
"Alisa", "Alisha", "Alison", "Alivia", "Aliya", "Aliyah", "Aliza", "Alize",
"Allan", "Allen", "Allene", "Allie", "Allison", "Ally", "Alphonso", "Alta",
"Althea", "Alva", "Alvah", "Alvena", "Alvera", "Alverta", "Alvina", "Alvis",
"Alyce", "Alycia", "Alysa", "Alysha", "Alyson", "Alysson", "Amalia", "Amanda",
"Amani", "Amara", "Amari", "Amaya", "Amber", "Ambrose", "Amelia", "Amelie",
"Amely", "America", "Americo", "Amie", "Amina", "Amir", "Amira", "Amiya",
"Amos", "Amparo", "Amy", "Amya", "Ana", "Anabel", "Anabelle", "Anahi",
"Anais", "Anastacio", "Anastasia", "Anderson", "Andre", "Andreane",
"Andreanne", "Andres", "Andrew", "Andy", "Angel", "Angela", "Angelica",
"Angelina", "Angeline", "Angelita", "Angelo", "Angie", "Angus", "Anibal",
"Anika", "Anissa", "Anita", "Aniya", "Aniyah", "Anjali", "Anna", "Annabel",
"Annabell", "Annabelle", "Annalise", "Annamae", "Annamarie", "Anne",
"Annetta", "Annette", "Annie", "Ansel", "Ansley", "Anthony", "Antoinette",
"Antone", "Antonetta", "Antonette", "Antonia", "Antonietta", "Antonina",
"Antonio", "Antwan", "Antwon", "Anya", "April", "Ara", "Araceli", "Aracely",
"Arch", "Archibald", "Ardella", "Arden", "Ardith", "Arely", "Ari", "Ariane",
"Arianna", "Aric", "Ariel", "Arielle", "Arjun", "Arlene", "Arlie", "Arlo",
"Armand", "Armando", "Armani", "Arnaldo", "Arne", "Arno", "Arnold", "Arnoldo",
"Arnulfo", "Aron", "Art", "Arthur", "Arturo", "Arvel", "Arvid", "Arvilla",
"Aryanna", "Asa", "Asha", "Ashlee", "Ashleigh", "Ashley", "Ashly", "Ashlynn",
"Ashton", "Ashtyn", "Asia", "Assunta", "Astrid", "Athena", "Aubree", "Aubrey",
"Audie", "Audra", "Audreanne", "Audrey", "August", "Augusta", "Augustine",
"Augustus", "Aurelia", "Aurelie", "Aurelio", "Aurore", "Austen", "Austin",
"Austyn", "Autumn", "Ava", "Avery", "Avis", "Axel", "Ayana", "Ayden", "Ayla",
"Aylin", "Baby", "Bailee", "Bailey", "Barbara", "Barney", "Baron", "Barrett",
"Barry", "Bart", "Bartholome", "Barton", "Baylee", "Beatrice", "Beau",
"Beaulah", "Bell", "Bella", "Belle", "Ben", "Benedict", "Benjamin", "Bennett",
"Bennie", "Benny", "Benton", "Berenice", "Bernadette", "Bernadine", "Bernard",
"Bernardo", "Berneice", "Bernhard", "Bernice", "Bernie", "Berniece",
"Bernita", "Berry", "Bert", "Berta", "Bertha", "Bertram", "Bertrand", "Beryl",
"Bessie", "Beth", "Bethany", "Bethel", "Betsy", "Bette", "Bettie", "Betty",
"Bettye", "Beulah", "Beverly", "Bianka", "Bill", "Billie", "Billy", "Birdie",
"Blair", "Blaise", "Blake", "Blanca", "Blanche", "Blaze", "Bo", "Bobbie",
"Bobby", "Bonita", "Bonnie", "Boris", "Boyd", "Brad", "Braden", "Bradford",
"Bradley", "Bradly", "Brady", "Braeden", "Brain", "Brandi", "Brando",
"Brandon", "Brandt", "Brandy", "Brandyn", "Brannon", "Branson", "Brant",
"Braulio", "Braxton", "Brayan", "Breana", "Breanna", "Breanne", "Brenda",
"Brendan", "Brenden", "Brendon", "Brenna", "Brennan", "Brennon", "Brent",
"Bret", "Brett", "Bria", "Brian", "Briana", "Brianne", "Brice", "Bridget",
"Bridgette", "Bridie", "Brielle", "Brigitte", "Brionna", "Brisa", "Britney",
"Brittany", "Brock", "Broderick", "Brody", "Brook", "Brooke", "Brooklyn",
"Brooks", "Brown", "Bruce", "Bryana", "Bryce", "Brycen", "Bryon", "Buck",
"Bud", "Buddy", "Buford", "Bulah", "Burdette", "Burley", "Burnice", "Buster",
"Cade", "Caden", "Caesar", "Caitlyn", "Cale", "Caleb", "Caleigh", "Cali",
"Calista", "Callie", "Camden", "Cameron", "Camila", "Camilla", "Camille",
"Camren", "Camron", "Camryn", "Camylle", "Candace", "Candelario", "Candice",
"Candida", "Candido", "Cara", "Carey", "Carissa", "Carlee", "Carleton",
"Carley", "Carli", "Carlie", "Carlo", "Carlos", "Carlotta", "Carmel",
"Carmela", "Carmella", "Carmelo", "Carmen", "Carmine", "Carol", "Carolanne",
"Carole", "Carolina", "Caroline", "Carolyn", "Carolyne", "Carrie", "Carroll",
"Carson", "Carter", "Cary", "Casandra", "Casey", "Casimer", "Casimir",
"Casper", "Cassandra", "Cassandre", "Cassidy", "Cassie", "Catalina",
"Caterina", "Catharine", "Catherine", "Cathrine", "Cathryn", "Cathy", "Cayla",
"Ceasar", "Cecelia", "Cecil", "Cecile", "Cecilia", "Cedrick", "Celestine",
"Celestino", "Celia", "Celine", "Cesar", "Chad", "Chadd", "Chadrick", "Chaim",
"Chance", "Chandler", "Chanel", "Chanelle", "Charity", "Charlene", "Charles",
"Charley", "Charlie", "Charlotte", "Chase", "Chasity", "Chauncey", "Chaya",
"Chaz", "Chelsea", "Chelsey", "Chelsie", "Chesley", "Chester", "Chet",
"Cheyanne", "Cheyenne", "Chloe", "Chris", "Christ", "Christa", "Christelle",
"Christian", "Christiana", "Christina", "Christine", "Christop", "Christophe",
"Christopher", "Christy", "Chyna", "Ciara", "Cicero", "Cielo", "Cierra",
"Cindy", "Citlalli", "Clair", "Claire", "Clara", "Clarabelle", "Clare",
"Clarissa", "Clark", "Claud", "Claude", "Claudia", "Claudie", "Claudine",
"Clay", "Clemens", "Clement", "Clementina", "Clementine", "Clemmie", "Cleo",
"Cleora", "Cleta", "Cletus", "Cleve", "Cleveland", "Clifford", "Clifton",
"Clint", "Clinton", "Clotilde", "Clovis", "Cloyd", "Clyde", "Coby", "Cody",
"Colby", "Cole", "Coleman", "Colin", "Colleen", "Collin", "Colt", "Colten",
"Colton", "Columbus", "Concepcion", "Conner", "Connie", "Connor", "Conor",
"Conrad", "Constance", "Constantin", "Consuelo", "Cooper", "Cora", "Coralie",
"Corbin", "Cordelia", "Cordell", "Cordia", "Cordie", "Corene", "Corine",
"Cornelius", "Cornell", "Corrine", "Cortez", "Cortney", "Cory", "Coty",
"Courtney", "Coy", "Craig", "Crawford", "Creola", "Cristal", "Cristian",
"Cristina", "Cristobal", "Cristopher", "Cruz", "Crystal", "Crystel", "Cullen",
"Curt", "Curtis", "Cydney", "Cynthia", "Cyril", "Cyrus", "Dagmar", "Dahlia",
"Daija", "Daisha", "Daisy", "Dakota", "Dale", "Dallas", "Dallin", "Dalton",
"Damaris", "Dameon", "Damian", "Damien", "Damion", "Damon", "Dan", "Dana",
"Dandre", "Dane", "D'angelo", "Dangelo", "Danial", "Daniela", "Daniella",
"Danielle", "Danika", "Dannie", "Danny", "Dante", "Danyka", "Daphne",
"Daphnee", "Daphney", "Darby", "Daren", "Darian", "Dariana", "Darien",
"Dario", "Darion", "Darius", "Darlene", "Daron", "Darrel", "Darrell",
"Darren", "Darrick", "Darrin", "Darrion", "Darron", "Darryl", "Darwin",
"Daryl", "Dashawn", "Dasia", "Dave", "David", "Davin", "Davion", "Davon",
"Davonte", "Dawn", "Dawson", "Dax", "Dayana", "Dayna", "Dayne", "Dayton",
"Dean", "Deangelo", "Deanna", "Deborah", "Declan", "Dedric", "Dedrick", "Dee",
"Deion", "Deja", "Dejah", "Dejon", "Dejuan", "Delaney", "Delbert", "Delfina",
"Delia", "Delilah", "Dell", "Della", "Delmer", "Delores", "Delpha", "Delphia",
"Delphine", "Delta", "Demarco", "Demarcus", "Demario", "Demetris",
"Demetrius", "Demond", "Dena", "Denis", "Dennis", "Deon", "Deondre",
"Deontae", "Deonte", "Dereck", "Derek", "Derick", "Deron", "Derrick",
"Deshaun", "Deshawn", "Desiree", "Desmond", "Dessie", "Destany", "Destin",
"Destinee", "Destiney", "Destini", "Destiny", "Devan", "Devante", "Deven",
"Devin", "Devon", "Devonte", "Devyn", "Dewayne", "Dewitt", "Dexter",
"Diamond", "Diana", "Dianna", "Diego", "Dillan", "Dillon", "Dimitri", "Dina",
"Dino", "Dion", "Dixie", "Dock", "Dolly", "Dolores", "Domenic", "Domenica",
"Domenick", "Domenico", "Domingo", "Dominic", "Dominique", "Don", "Donald",
"Donato", "Donavon", "Donna", "Donnell", "Donnie", "Donny", "Dora", "Dorcas",
"Dorian", "Doris", "Dorothea", "Dorothy", "Dorris", "Dortha", "Dorthy",
"Doug", "Douglas", "Dovie", "Doyle", "Drake", "Drew", "Duane", "Dudley",
"Dulce", "Duncan", "Durward", "Dustin", "Dusty", "Dwight", "Dylan", "Earl",
"Earlene", "Earline", "Earnest", "Earnestine", "Easter", "Easton", "Ebba",
"Ebony", "Ed", "Eda", "Edd", "Eddie", "Eden", "Edgar", "Edgardo", "Edison",
"Edmond", "Edmund", "Edna", "Eduardo", "Edward", "Edwardo", "Edwin", "Edwina",
"Edyth", "Edythe", "Effie", "Efrain", "Efren", "Eileen", "Einar", "Eino",
"Eladio", "Elaina", "Elbert", "Elda", "Eldon", "Eldora", "Eldred", "Eldridge",
"Eleanora", "Eleanore", "Eleazar", "Electa", "Elena", "Elenor", "Elenora",
"Eleonore", "Elfrieda", "Eli", "Elian", "Eliane", "Elias", "Eliezer",
"Elijah", "Elinor", "Elinore", "Elisa", "Elisabeth", "Elise", "Eliseo",
"Elisha", "Elissa", "Eliza", "Elizabeth", "Ella", "Ellen", "Ellie", "Elliot",
"Elliott", "Ellis", "Ellsworth", "Elmer", "Elmira", "Elmo", "Elmore", "Elna",
"Elnora", "Elody", "Eloisa", "Eloise", "Elouise", "Eloy", "Elroy", "Elsa",
"Else", "Elsie", "Elta", "Elton", "Elva", "Elvera", "Elvie", "Elvis", "Elwin",
"Elwyn", "Elyse", "Elyssa", "Elza", "Emanuel", "Emelia", "Emelie", "Emely",
"Emerald", "Emerson", "Emery", "Emie", "Emil", "Emile", "Emilia", "Emiliano",
"Emilie", "Emilio", "Emily", "Emma", "Emmalee", "Emmanuel", "Emmanuelle",
"Emmet", "Emmett", "Emmie", "Emmitt", "Emmy", "Emory", "Ena", "Enid", "Enoch",
"Enola", "Enos", "Enrico", "Enrique", "Ephraim", "Era", "Eriberto", "Eric",
"Erica", "Erich", "Erick", "Ericka", "Erik", "Erika", "Erin", "Erling",
"Erna", "Ernest", "Ernestina", "Ernestine", "Ernesto", "Ernie", "Ervin",
"Erwin", "Eryn", "Esmeralda", "Esperanza", "Esta", "Esteban", "Estefania",
"Estel", "Estell", "Estella", "Estelle", "Estevan", "Esther", "Estrella",
"Etha", "Ethan", "Ethel", "Ethelyn", "Ethyl", "Ettie", "Eudora", "Eugene",
"Eugenia", "Eula", "Eulah", "Eulalia", "Euna", "Eunice", "Eusebio", "Eva",
"Evalyn", "Evan", "Evangeline", "Evans", "Eve", "Eveline", "Evelyn",
"Everardo", "Everett", "Everette", "Evert", "Evie", "Ewald", "Ewell",
"Ezekiel", "Ezequiel", "Ezra", "Fabian", "Fabiola", "Fae", "Fannie", "Fanny",
"Fatima", "Faustino", "Fausto", "Favian", "Fay", "Faye", "Federico",
"Felicia", "Felicita", "Felicity", "Felipa", "Felipe", "Felix", "Felton",
"Fermin", "Fern", "Fernando", "Ferne", "Fidel", "Filiberto", "Filomena",
"Finn", "Fiona", "Flavie", "Flavio", "Fleta", "Fletcher", "Flo", "Florence",
"Florencio", "Florian", "Florida", "Florine", "Flossie", "Floy", "Floyd",
"Ford", "Forest", "Forrest", "Foster", "Frances", "Francesca", "Francesco",
"Francis", "Francisca", "Francisco", "Franco", "Frank", "Frankie", "Franz",
"Fred", "Freda", "Freddie", "Freddy", "Frederic", "Frederick", "Frederik",
"Frederique", "Fredrick", "Fredy", "Freeda", "Freeman", "Freida", "Frida",
"Frieda", "Friedrich", "Fritz", "Furman", "Gabe", "Gabriel", "Gabriella",
"Gabrielle", "Gaetano", "Gage", "Gail", "Gardner", "Garett", "Garfield",
"Garland", "Garnet", "Garnett", "Garret", "Garrett", "Garrick", "Garrison",
"Garry", "Garth", "Gaston", "Gavin", "Gay", "Gayle", "Gaylord", "Gene",
"General", "Genesis", "Genevieve", "Gennaro", "Genoveva", "Geo", "Geoffrey",
"George", "Georgette", "Georgiana", "Georgianna", "Geovanni", "Geovanny",
"Geovany", "Gerald", "Geraldine", "Gerard", "Gerardo", "Gerda", "Gerhard",
"Germaine", "German", "Gerry", "Gerson", "Gertrude", "Gia", "Gianni",
"Gideon", "Gilbert", "Gilberto", "Gilda", "Giles", "Gillian", "Gina", "Gino",
"Giovani", "Giovanna", "Giovanni", "Giovanny", "Gisselle", "Giuseppe",
"Gladyce", "Gladys", "Glen", "Glenda", "Glenna", "Glennie", "Gloria",
"Godfrey", "Golda", "Golden", "Gonzalo", "Gordon", "Grace", "Gracie",
"Graciela", "Grady", "Graham", "Grant", "Granville", "Grayce", "Grayson",
"Green", "Greg", "Gregg", "Gregoria", "Gregorio", "Gregory", "Greta",
"Gretchen", "Greyson", "Griffin", "Grover", "Guadalupe", "Gudrun", "Guido",
"Guillermo", "Guiseppe", "Gunnar", "Gunner", "Gus", "Gussie", "Gust",
"Gustave", "Guy", "Gwen", "Gwendolyn", "Hadley", "Hailee", "Hailey", "Hailie",
"Hal", "Haleigh", "Haley", "Halie", "Halle", "Hallie", "Hank", "Hanna",
"Hannah", "Hans", "Hardy", "Harley", "Harmon", "Harmony", "Harold",
"Harrison", "Harry", "Harvey", "Haskell", "Hassan", "Hassie", "Hattie",
"Haven", "Hayden", "Haylee", "Hayley", "Haylie", "Hazel", "Hazle", "Heath",
"Heather", "Heaven", "Heber", "Hector", "Heidi", "Helen", "Helena", "Helene",
"Helga", "Hellen", "Helmer", "Heloise", "Henderson", "Henri", "Henriette",
"Henry", "Herbert", "Herman", "Hermann", "Hermina", "Herminia", "Herminio",
"Hershel", "Herta", "Hertha", "Hester", "Hettie", "Hilario", "Hilbert",
"Hilda", "Hildegard", "Hillard", "Hillary", "Hilma", "Hilton", "Hipolito",
"Hiram", "Hobart", "Holden", "Hollie", "Hollis", "Holly", "Hope", "Horace",
"Horacio", "Hortense", "Hosea", "Houston", "Howard", "Howell", "Hoyt",
"Hubert", "Hudson", "Hugh", "Hulda", "Humberto", "Hunter", "Hyman", "Ian",
"Ibrahim", "Icie", "Ida", "Idell", "Idella", "Ignacio", "Ignatius", "Ike",
"Ila", "Ilene", "Iliana", "Ima", "Imani", "Imelda", "Immanuel", "Imogene",
"Ines", "Irma", "Irving", "Irwin", "Isaac", "Isabel", "Isabell", "Isabella",
"Isabelle", "Isac", "Isadore", "Isai", "Isaiah", "Isaias", "Isidro", "Ismael",
"Isobel", "Isom", "Israel", "Issac", "Itzel", "Iva", "Ivah", "Ivory", "Ivy",
"Izabella", "Izaiah", "Jabari", "Jace", "Jacey", "Jacinthe", "Jacinto",
"Jack", "Jackeline", "Jackie", "Jacklyn", "Jackson", "Jacky", "Jaclyn",
"Jacquelyn", "Jacques", "Jacynthe", "Jada", "Jade", "Jaden", "Jadon", "Jadyn",
"Jaeden", "Jaida", "Jaiden", "Jailyn", "Jaime", "Jairo", "Jakayla", "Jake",
"Jakob", "Jaleel", "Jalen", "Jalon", "Jalyn", "Jamaal", "Jamal", "Jamar",
"Jamarcus", "Jamel", "Jameson", "Jamey", "Jamie", "Jamil", "Jamir", "Jamison",
"Jammie", "Jan", "Jana", "Janae", "Jane", "Janelle", "Janessa", "Janet",
"Janice", "Janick", "Janie", "Janis", "Janiya", "Jannie", "Jany", "Jaquan",
"Jaquelin", "Jaqueline", "Jared", "Jaren", "Jarod", "Jaron", "Jarred",
"Jarrell", "Jarret", "Jarrett", "Jarrod", "Jarvis", "Jasen", "Jasmin",
"Jason", "Jasper", "Jaunita", "Javier", "Javon", "Javonte", "Jay", "Jayce",
"Jaycee", "Jayda", "Jayde", "Jayden", "Jaydon", "Jaylan", "Jaylen", "Jaylin",
"Jaylon", "Jayme", "Jayne", "Jayson", "Jazlyn", "Jazmin", "Jazmyn", "Jazmyne",
"Jean", "Jeanette", "Jeanie", "Jeanne", "Jed", "Jedediah", "Jedidiah", "Jeff",
"Jefferey", "Jeffery", "Jeffrey", "Jeffry", "Jena", "Jenifer", "Jennie",
"Jennifer", "Jennings", "Jennyfer", "Jensen", "Jerad", "Jerald", "Jeramie",
"Jeramy", "Jerel", "Jeremie", "Jeremy", "Jermain", "Jermaine", "Jermey",
"Jerod", "Jerome", "Jeromy", "Jerrell", "Jerrod", "Jerrold", "Jerry", "Jess",
"Jesse", "Jessica", "Jessie", "Jessika", "Jessy", "Jessyca", "Jesus", "Jett",
"Jettie", "Jevon", "Jewel", "Jewell", "Jillian", "Jimmie", "Jimmy", "Jo",
"Joan", "Joana", "Joanie", "Joanne", "Joannie", "Joanny", "Joany", "Joaquin",
"Jocelyn", "Jodie", "Jody", "Joe", "Joel", "Joelle", "Joesph", "Joey",
"Johan", "Johann", "Johanna", "Johathan", "John", "Johnathan", "Johnathon",
"Johnnie", "Johnny", "Johnpaul", "Johnson", "Jolie", "Jon", "Jonas",
"Jonatan", "Jonathan", "Jonathon", "Jordan", "Jordane", "Jordi", "Jordon",
"Jordy", "Jordyn", "Jorge", "Jose", "Josefa", "Josefina", "Joseph",
"Josephine", "Josh", "Joshua", "Joshuah", "Josiah", "Josiane", "Josianne",
"Josie", "Josue", "Jovan", "Jovani", "Jovanny", "Jovany", "Joy", "Joyce",
"Juana", "Juanita", "Judah", "Judd", "Jude", "Judge", "Judson", "Judy",
"Jules", "Julia", "Julian", "Juliana", "Julianne", "Julie", "Julien",
"Juliet", "Julio", "Julius", "June", "Junior", "Junius", "Justen", "Justice",
"Justina", "Justine", "Juston", "Justus", "Justyn", "Juvenal", "Juwan",
"Kacey", "Kaci", "Kacie", "Kade", "Kaden", "Kadin", "Kaela", "Kaelyn", "Kaia",
"Kailee", "Kailey", "Kailyn", "Kaitlin", "Kaitlyn", "Kale", "Kaleb",
"Kaleigh", "Kaley", "Kali", "Kallie", "Kameron", "Kamille", "Kamren",
"Kamron", "Kamryn", "Kane", "Kara", "Kareem", "Karelle", "Karen", "Kari",
"Kariane", "Karianne", "Karina", "Karine", "Karl", "Karlee", "Karley",
"Karli", "Karlie", "Karolann", "Karson", "Kasandra", "Kasey", "Kassandra",
"Katarina", "Katelin", "Katelyn", "Katelynn", "Katharina", "Katherine",
"Katheryn", "Kathleen", "Kathlyn", "Kathryn", "Kathryne", "Katlyn", "Katlynn",
"Katrina", "Katrine", "Kattie", "Kavon", "Kay", "Kaya", "Kaycee", "Kayden",
"Kayla", "Kaylah", "Kaylee", "Kayleigh", "Kayley", "Kayli", "Kaylie",
"Kaylin", "Keagan", "Keanu", "Keara", "Keaton", "Keegan", "Keeley", "Keely",
"Keenan", "Keira", "Keith", "Kellen", "Kelley", "Kelli", "Kellie", "Kelly",
"Kelsi", "Kelsie", "Kelton", "Kelvin", "Ken", "Kendall", "Kendra", "Kendrick",
"Kenna", "Kennedi", "Kennedy", "Kenneth", "Kennith", "Kenny", "Kenton",
"Kenya", "Kenyatta", "Kenyon", "Keon", "Keshaun", "Keshawn", "Keven", "Kevin",
"Kevon", "Keyon", "Keyshawn", "Khalid", "Khalil", "Kian", "Kiana", "Kianna",
"Kiara", "Kiarra", "Kiel", "Kiera", "Kieran", "Kiley", "Kim", "Kimberly",
"King", "Kip", "Kira", "Kirk", "Kirsten", "Kirstin", "Kitty", "Kobe", "Koby",
"Kody", "Kolby", "Kole", "Korbin", "Korey", "Kory", "Kraig", "Kris", "Krista",
"Kristian", "Kristin", "Kristina", "Kristofer", "Kristoffer", "Kristopher",
"Kristy", "Krystal", "Krystel", "Krystina", "Kurt", "Kurtis", "Kyla", "Kyle",
"Kylee", "Kyleigh", "Kyler", "Kylie", "Kyra", "Lacey", "Lacy", "Ladarius",
"Lafayette", "Laila", "Laisha", "Lamar", "Lambert", "Lamont", "Lance",
"Landen", "Lane", "Laney", "Larissa", "Laron", "Larry", "Larue", "Laura",
"Laurel", "Lauren", "Laurence", "Lauretta", "Lauriane", "Laurianne", "Laurie",
"Laurine", "Laury", "Lauryn", "Lavada", "Lavern", "Laverna", "Laverne",
"Lavina", "Lavinia", "Lavon", "Lavonne", "Lawrence", "Lawson", "Layla",
"Layne", "Lazaro", "Lea", "Leann", "Leanna", "Leanne", "Leatha", "Leda",
"Lee", "Leif", "Leila", "Leilani", "Lela", "Lelah", "Leland", "Lelia",
"Lempi", "Lemuel", "Lenna", "Lennie", "Lenny", "Lenora", "Lenore", "Leo",
"Leola", "Leon", "Leonard", "Leonardo", "Leone", "Leonel", "Leonie", "Leonor",
"Leonora", "Leopold", "Leopoldo", "Leora", "Lera", "Lesley", "Leslie",
"Lesly", "Lessie", "Lester", "Leta", "Letha", "Letitia", "Levi", "Lew",
"Lewis", "Lexi", "Lexie", "Lexus", "Lia", "Liam", "Liana", "Libbie", "Libby",
"Lila", "Lilian", "Liliana", "Liliane", "Lilla", "Lillian", "Lilliana",
"Lillie", "Lilly", "Lily", "Lilyan", "Lina", "Lincoln", "Linda", "Lindsay",
"Lindsey", "Linnea", "Linnie", "Linwood", "Lionel", "Lisa", "Lisandro",
"Lisette", "Litzy", "Liza", "Lizeth", "Lizzie", "Llewellyn", "Lloyd", "Logan",
"Lois", "Lola", "Lolita", "Loma", "Lon", "London", "Lonie", "Lonnie", "Lonny",
"Lonzo", "Lora", "Loraine", "Loren", "Lorena", "Lorenz", "Lorenza", "Lorenzo",
"Lori", "Lorine", "Lorna", "Lottie", "Lou", "Louie", "Louisa", "Lourdes",
"Louvenia", "Lowell", "Loy", "Loyal", "Loyce", "Lucas", "Luciano", "Lucie",
"Lucienne", "Lucile", "Lucinda", "Lucio", "Lucious", "Lucius", "Lucy",
"Ludie", "Ludwig", "Lue", "Luella", "Luigi", "Luis", "Luisa", "Lukas", "Lula",
"Lulu", "Luna", "Lupe", "Lura", "Lurline", "Luther", "Luz", "Lyda", "Lydia",
"Lyla", "Lynn", "Lyric", "Lysanne", "Mabel", "Mabelle", "Mable", "Mac",
"Macey", "Maci", "Macie", "Mack", "Mackenzie", "Macy", "Madaline", "Madalyn",
"Maddison", "Madeline", "Madelyn", "Madelynn", "Madge", "Madie", "Madilyn",
"Madisen", "Madison", "Madisyn", "Madonna", "Madyson", "Mae", "Maegan",
"Maeve", "Mafalda", "Magali", "Magdalen", "Magdalena", "Maggie", "Magnolia",
"Magnus", "Maia", "Maida", "Maiya", "Major", "Makayla", "Makenna", "Makenzie",
"Malachi", "Malcolm", "Malika", "Malinda", "Mallie", "Mallory", "Malvina",
"Mandy", "Manley", "Manuel", "Manuela", "Mara", "Marc", "Marcel", "Marcelina",
"Marcelino", "Marcella", "Marcelle", "Marcellus", "Marcelo", "Marcia",
"Marco", "Marcos", "Marcus", "Margaret", "Margarete", "Margarett",
"Margaretta", "Margarette", "Margarita", "Marge", "Margie", "Margot",
"Margret", "Marguerite", "Maria", "Mariah", "Mariam", "Marian", "Mariana",
"Mariane", "Marianna", "Marianne", "Mariano", "Maribel", "Marie", "Mariela",
"Marielle", "Marietta", "Marilie", "Marilou", "Marilyne", "Marina", "Mario",
"Marion", "Marisa", "Marisol", "Maritza", "Marjolaine", "Marjorie", "Marjory",
"Mark", "Markus", "Marlee", "Marlen", "Marlene", "Marley", "Marlin", "Marlon",
"Marques", "Marquis", "Marquise", "Marshall", "Marta", "Martin", "Martina",
"Martine", "Marty", "Marvin", "Mary", "Maryam", "Maryjane", "Maryse", "Mason",
"Mateo", "Mathew", "Mathias", "Mathilde", "Matilda", "Matilde", "Matt",
"Matteo", "Mattie", "Maud", "Maude", "Maudie", "Maureen", "Maurice",
"Mauricio", "Maurine", "Maverick", "Mavis", "Max", "Maxie", "Maxime",
"Maximilian", "Maximillia", "Maximillian", "Maximo", "Maximus", "Maxine",
"Maxwell", "May", "Maya", "Maybell", "Maybelle", "Maye", "Maymie", "Maynard",
"Mayra", "Mazie", "Mckayla", "Mckenna", "Mckenzie", "Meagan", "Meaghan",
"Meda", "Megane", "Meggie", "Meghan", "Mekhi", "Melany", "Melba", "Melisa",
"Melissa", "Mellie", "Melody", "Melvin", "Melvina", "Melyna", "Melyssa",
"Mercedes", "Meredith", "Merl", "Merle", "Merlin", "Merritt", "Mertie",
"Mervin", "Meta", "Mia", "Micaela", "Micah", "Michael", "Michaela", "Michale",
"Micheal", "Michel", "Michele", "Michelle", "Miguel", "Mikayla", "Mike",
"Mikel", "Milan", "Miles", "Milford", "Miller", "Millie", "Milo", "Milton",
"Mina", "Minerva", "Minnie", "Miracle", "Mireille", "Mireya", "Misael",
"Missouri", "Misty", "Mitchel", "Mitchell", "Mittie", "Modesta", "Modesto",
"Mohamed", "Mohammad", "Mohammed", "Moises", "Mollie", "Molly", "Mona",
"Monica", "Monique", "Monroe", "Monserrat", "Monserrate", "Montana", "Monte",
"Monty", "Morgan", "Moriah", "Morris", "Mortimer", "Morton", "Mose", "Moses",
"Moshe", "Mossie", "Mozell", "Mozelle", "Muhammad", "Muriel", "Murl",
"Murphy", "Murray", "Mustafa", "Mya", "Myah", "Mylene", "Myles", "Myra",
"Myriam", "Myrl", "Myrna", "Myron", "Myrtice", "Myrtie", "Myrtis", "Myrtle",
"Nadia", "Nakia", "Name", "Nannie", "Naomi", "Naomie", "Napoleon", "Narciso",
"Nash", "Nasir", "Nat", "Natalia", "Natalie", "Natasha", "Nathan",
"Nathanael", "Nathanial", "Nathaniel", "Nathen", "Nayeli", "Neal", "Ned",
"Nedra", "Neha", "Neil", "Nelda", "Nella", "Nelle", "Nellie", "Nels",
"Nelson", "Neoma", "Nestor", "Nettie", "Neva", "Newell", "Newton", "Nia",
"Nicholas", "Nicholaus", "Nichole", "Nick", "Nicklaus", "Nickolas", "Nico",
"Nicola", "Nicolas", "Nicole", "Nicolette", "Nigel", "Nikita", "Nikki",
"Nikko", "Niko", "Nikolas", "Nils", "Nina", "Noah", "Noble", "Noe", "Noel",
"Noelia", "Noemi", "Noemie", "Noemy", "Nola", "Nolan", "Nona", "Nora",
"Norbert", "Norberto", "Norene", "Norma", "Norris", "Norval", "Norwood",
"Nova", "Novella", "Nya", "Nyah", "Nyasia", "Obie", "Oceane", "Ocie",
"Octavia", "Oda", "Odell", "Odessa", "Odie", "Ofelia", "Okey", "Ola", "Olaf",
"Ole", "Olen", "Oleta", "Olga", "Olin", "Oliver", "Ollie", "Oma", "Omari",
"Omer", "Ona", "Onie", "Opal", "Ophelia", "Ora", "Oral", "Oran", "Oren",
"Orie", "Orin", "Orion", "Orland", "Orlando", "Orlo", "Orpha", "Orrin",
"Orval", "Orville", "Osbaldo", "Osborne", "Oscar", "Osvaldo", "Oswald",
"Oswaldo", "Otha", "Otho", "Otilia", "Otis", "Ottilie", "Ottis", "Otto",
"Ova", "Owen", "Ozella", "Pablo", "Paige", "Palma", "Pamela", "Pansy",
"Paolo", "Paris", "Parker", "Pascale", "Pasquale", "Pat", "Patience",
"Patricia", "Patrick", "Patsy", "Pattie", "Paul", "Paula", "Pauline",
"Paxton", "Payton", "Pearl", "Pearlie", "Pearline", "Pedro", "Peggie",
"Penelope", "Percival", "Percy", "Perry", "Pete", "Peter", "Petra", "Peyton",
"Philip", "Phoebe", "Phyllis", "Pierce", "Pierre", "Pietro", "Pink", "Pinkie",
"Piper", "Polly", "Porter", "Precious", "Presley", "Preston", "Price",
"Prince", "Princess", "Priscilla", "Providenci", "Prudence", "Queen",
"Queenie", "Quentin", "Quincy", "Quinn", "Quinten", "Quinton", "Rachael",
"Rachel", "Rachelle", "Rae", "Raegan", "Rafael", "Rafaela", "Raheem",
"Rahsaan", "Rahul", "Raina", "Raleigh", "Ralph", "Ramiro", "Ramon", "Ramona",
"Randal", "Randall", "Randi", "Randy", "Ransom", "Raoul", "Raphael",
"Raphaelle", "Raquel", "Rashad", "Rashawn", "Rasheed", "Raul", "Raven", "Ray",
"Raymond", "Raymundo", "Reagan", "Reanna", "Reba", "Rebeca", "Rebecca",
"Rebeka", "Rebekah", "Reece", "Reed", "Reese", "Regan", "Reggie", "Reginald",
"Reid", "Reilly", "Reina", "Reinhold", "Remington", "Rene", "Renee", "Ressie",
"Reta", "Retha", "Retta", "Reuben", "Reva", "Rex", "Rey", "Reyes", "Reymundo",
"Reyna", "Reynold", "Rhea", "Rhett", "Rhianna", "Rhiannon", "Rhoda",
"Ricardo", "Richard", "Richie", "Richmond", "Rick", "Rickey", "Rickie",
"Ricky", "Rico", "Rigoberto", "Riley", "Rita", "River", "Robb", "Robbie",
"Robert", "Roberta", "Roberto", "Robin", "Robyn", "Rocio", "Rocky", "Rod",
"Roderick", "Rodger", "Rodolfo", "Rodrick", "Rodrigo", "Roel", "Rogelio",
"Roger", "Rogers", "Rolando", "Rollin", "Roma", "Romaine", "Roman", "Ron",
"Ronaldo", "Ronny", "Roosevelt", "Rory", "Rosa", "Rosalee", "Rosalia",
"Rosalind", "Rosalinda", "Rosalyn", "Rosamond", "Rosanna", "Rosario",
"Roscoe", "Rose", "Rosella", "Roselyn", "Rosemarie", "Rosemary", "Rosendo",
"Rosetta", "Rosie", "Rosina", "Roslyn", "Ross", "Rossie", "Rowan", "Rowena",
"Rowland", "Roxane", "Roxanne", "Roy", "Royal", "Royce", "Rozella", "Ruben",
"Rubie", "Ruby", "Rubye", "Rudolph", "Rudy", "Rupert", "Russ", "Russel",
"Russell", "Rusty", "Ruth", "Ruthe", "Ruthie", "Ryan", "Ryann", "Ryder",
"Rylan", "Rylee", "Ryleigh", "Ryley", "Sabina", "Sabrina", "Sabryna", "Sadie",
"Sadye", "Sage", "Saige", "Sallie", "Sally", "Salma", "Salvador", "Salvatore",
"Sam", "Samanta", "Samantha", "Samara", "Samir", "Sammie", "Sammy", "Samson",
"Sandra", "Sandrine", "Sandy", "Sanford", "Santa", "Santiago", "Santina",
"Santino", "Santos", "Sarah", "Sarai", "Sarina", "Sasha", "Saul", "Savanah",
"Savanna", "Savannah", "Savion", "Scarlett", "Schuyler", "Scot", "Scottie",
"Scotty", "Seamus", "Sean", "Sebastian", "Sedrick", "Selena", "Selina",
"Selmer", "Serena", "Serenity", "Seth", "Shad", "Shaina", "Shakira", "Shana",
"Shane", "Shanel", "Shanelle", "Shania", "Shanie", "Shaniya", "Shanna",
"Shannon", "Shanny", "Shanon", "Shany", "Sharon", "Shaun", "Shawn", "Shawna",
"Shaylee", "Shayna", "Shayne", "Shea", "Sheila", "Sheldon", "Shemar",
"Sheridan", "Sherman", "Sherwood", "Shirley", "Shyann", "Shyanne", "Sibyl",
"Sid", "Sidney", "Sienna", "Sierra", "Sigmund", "Sigrid", "Sigurd", "Silas",
"Sim", "Simeon", "Simone", "Sincere", "Sister", "Skye", "Skyla", "Skylar",
"Sofia", "Soledad", "Solon", "Sonia", "Sonny", "Sonya", "Sophia", "Sophie",
"Spencer", "Stacey", "Stacy", "Stan", "Stanford", "Stanley", "Stanton",
"Stefan", "Stefanie", "Stella", "Stephan", "Stephania", "Stephanie",
"Stephany", "Stephen", "Stephon", "Sterling", "Steve", "Stevie", "Stewart",
"Stone", "Stuart", "Summer", "Sunny", "Susan", "Susana", "Susanna", "Susie",
"Suzanne", "Sven", "Syble", "Sydnee", "Sydney", "Sydni", "Sydnie", "Sylvan",
"Sylvester", "Sylvia", "Tabitha", "Tad", "Talia", "Talon", "Tamara", "Tamia",
"Tania", "Tanner", "Tanya", "Tara", "Taryn", "Tate", "Tatum", "Tatyana",
"Taurean", "Tavares", "Taya", "Taylor", "Teagan", "Ted", "Telly", "Terence",
"Teresa", "Terrance", "Terrell", "Terrence", "Terrill", "Terry", "Tess",
"Tessie", "Tevin", "Thad", "Thaddeus", "Thalia", "Thea", "Thelma", "Theo",
"Theodora", "Theodore", "Theresa", "Therese", "Theresia", "Theron", "Thomas",
"Thora", "Thurman", "Tia", "Tiana", "Tianna", "Tiara", "Tierra", "Tiffany",
"Tillman", "Timmothy", "Timmy", "Timothy", "Tina", "Tito", "Titus", "Tobin",
"Toby", "Tod", "Tom", "Tomas", "Tomasa", "Tommie", "Toney", "Toni", "Tony",
"Torey", "Torrance", "Torrey", "Toy", "Trace", "Tracey", "Tracy", "Travis",
"Travon", "Tre", "Tremaine", "Tremayne", "Trent", "Trenton", "Tressa",
"Tressie", "Treva", "Trever", "Trevion", "Trevor", "Trey", "Trinity",
"Trisha", "Tristian", "Tristin", "Triston", "Troy", "Trudie", "Trycia",
"Trystan", "Turner", "Twila", "Tyler", "Tyra", "Tyree", "Tyreek", "Tyrel",
"Tyrell", "Tyrese", "Tyrique", "Tyshawn", "Tyson", "Ubaldo", "Ulices",
"Ulises", "Una", "Unique", "Urban", "Uriah", "Uriel", "Ursula", "Vada",
"Valentin", "Valentina", "Valentine", "Valerie", "Vallie", "Van", "Vance",
"Vanessa", "Vaughn", "Veda", "Velda", "Vella", "Velma", "Velva", "Vena",
"Verda", "Verdie", "Vergie", "Verla", "Verlie", "Vern", "Verna", "Verner",
"Vernice", "Vernie", "Vernon", "Verona", "Veronica", "Vesta", "Vicenta",
"Vicente", "Vickie", "Vicky", "Victor", "Victoria", "Vida", "Vidal", "Vilma",
"Vince", "Vincent", "Vincenza", "Vincenzo", "Vinnie", "Viola", "Violet",
"Violette", "Virgie", "Virgil", "Virginia", "Virginie", "Vita", "Vito",
"Viva", "Vivian", "Viviane", "Vivianne", "Vivien", "Vivienne", "Vladimir",
"Wade", "Waino", "Waldo", "Walker", "Wallace", "Walter", "Walton", "Wanda",
"Ward", "Warren", "Watson", "Wava", "Waylon", "Wayne", "Webster", "Weldon",
"Wellington", "Wendell", "Wendy", "Werner", "Westley", "Weston", "Whitney",
"Wilber", "Wilbert", "Wilburn", "Wiley", "Wilford", "Wilfred", "Wilfredo",
"Wilfrid", "Wilhelm", "Wilhelmine", "Will", "Willa", "Willard", "William",
"Willie", "Willis", "Willow", "Willy", "Wilma", "Wilmer", "Wilson", "Wilton",
"Winfield", "Winifred", "Winnifred", "Winona", "Winston", "Woodrow", "Wyatt",
"Wyman", "Xander", "Xavier", "Xzavier", "Yadira", "Yasmeen", "Yasmin",
"Yasmine", "Yazmin", "Yesenia", "Yessenia", "Yolanda", "Yoshiko", "Yvette",
"Yvonne", "Zachariah", "Zachary", "Zachery", "Zack", "Zackary", "Zackery",
"Zakary", "Zander", "Zane", "Zaria", "Zechariah", "Zelda", "Zella", "Zelma",
"Zena", "Zetta", "Zion", "Zita", "Zoe", "Zoey", "Zoie", "Zoila", "Zola",
"Zora", "Zula"
];
/**
* Generate random username.
* @returns {string} random username
*/
function generateUsername () {
var name = RandomUtil.randomElement(names);
var suffix = RandomUtil.randomAlphanumStr(3);
return name + '-' + suffix;
}
module.exports = {
generateUsername: generateUsername
};

View File

@ -59,7 +59,7 @@ function filterNodeFromPresenceJSON(pres, nodeName){
return res;
}
function ChatRoom(connection, jid, password, XMPP, options) {
function ChatRoom(connection, jid, password, XMPP, options, settings) {
this.eventEmitter = new EventEmitter();
this.xmpp = XMPP;
this.connection = connection;
@ -75,7 +75,8 @@ function ChatRoom(connection, jid, password, XMPP, options) {
this.focusMucJid = null;
this.bridgeIsDown = false;
this.options = options || {};
this.moderator = new Moderator(this.roomjid, this.xmpp, this.eventEmitter);
this.moderator = new Moderator(this.roomjid, this.xmpp, this.eventEmitter,
settings);
this.initPresenceMap();
this.session = null;
var self = this;

View File

@ -23,7 +23,9 @@ function TraceablePeerConnection(ice_config, constraints, session) {
var Interop = require('sdp-interop').Interop;
this.interop = new Interop();
var Simulcast = require('sdp-simulcast');
this.simulcast = new Simulcast({numOfLayers: 3, explodeRemoteSimulcast: false});
this.simulcast = new Simulcast({numOfLayers: 3,
explodeRemoteSimulcast: false});
this.eventEmitter = this.session.room.eventEmitter;
// override as desired
this.trace = function (what, info) {
@ -324,7 +326,8 @@ TraceablePeerConnection.prototype.setLocalDescription
// if we're running on FF, transform to Plan A first.
if (RTCBrowserType.usesUnifiedPlan()) {
description = this.interop.toUnifiedPlan(description);
this.trace('setLocalDescription::postTransform (Plan A)', dumpSDP(description));
this.trace('setLocalDescription::postTransform (Plan A)',
dumpSDP(description));
}
var self = this;
@ -335,14 +338,11 @@ TraceablePeerConnection.prototype.setLocalDescription
},
function (err) {
self.trace('setLocalDescriptionOnFailure', err);
self.eventEmitter.emit(XMPPEvents.SET_LOCAL_DESCRIPTION_FAILED,
err, self.peerconnection);
failureCallback(err);
}
);
/*
if (this.statsinterval === null && this.maxstats > 0) {
// start gathering stats
}
*/
};
TraceablePeerConnection.prototype.setRemoteDescription
@ -370,6 +370,8 @@ TraceablePeerConnection.prototype.setRemoteDescription
},
function (err) {
self.trace('setRemoteDescriptionOnFailure', err);
self.eventEmitter.emit(XMPPEvents.SET_REMOTE_DESCRIPTION_FAILED,
err, self.peerconnection);
failureCallback(err);
}
);
@ -411,14 +413,18 @@ TraceablePeerConnection.prototype.createOffer
self.trace('createOfferOnSuccess::mungeLocalVideoSSRC', dumpSDP(offer));
}
if (!self.session.room.options.disableSimulcast && self.simulcast.isSupported()) {
if (!self.session.room.options.disableSimulcast
&& self.simulcast.isSupported()) {
offer = self.simulcast.mungeLocalDescription(offer);
self.trace('createOfferOnSuccess::postTransform (simulcast)', dumpSDP(offer));
self.trace('createOfferOnSuccess::postTransform (simulcast)',
dumpSDP(offer));
}
successCallback(offer);
},
function(err) {
self.trace('createOfferOnFailure', err);
self.eventEmitter.emit(XMPPEvents.CREATE_OFFER_FAILED, err,
self.peerconnection);
failureCallback(err);
},
constraints
@ -435,7 +441,8 @@ TraceablePeerConnection.prototype.createAnswer
// if we're running on FF, transform to Plan A first.
if (RTCBrowserType.usesUnifiedPlan()) {
answer = self.interop.toPlanB(answer);
self.trace('createAnswerOnSuccess::postTransform (Plan B)', dumpSDP(answer));
self.trace('createAnswerOnSuccess::postTransform (Plan B)',
dumpSDP(answer));
}
if (RTCBrowserType.isChrome())
@ -444,14 +451,18 @@ TraceablePeerConnection.prototype.createAnswer
self.trace('createAnswerOnSuccess::mungeLocalVideoSSRC', dumpSDP(answer));
}
if (!self.session.room.options.disableSimulcast && self.simulcast.isSupported()) {
if (!self.session.room.options.disableSimulcast
&& self.simulcast.isSupported()) {
answer = self.simulcast.mungeLocalDescription(answer);
self.trace('createAnswerOnSuccess::postTransform (simulcast)', dumpSDP(answer));
self.trace('createAnswerOnSuccess::postTransform (simulcast)',
dumpSDP(answer));
}
successCallback(answer);
},
function(err) {
self.trace('createAnswerOnFailure', err);
self.eventEmitter.emit(XMPPEvents.CREATE_ANSWER_FAILED, err,
self.peerconnection);
failureCallback(err);
},
constraints

View File

@ -2,7 +2,6 @@
var logger = require("jitsi-meet-logger").getLogger(__filename);
var XMPPEvents = require("../../service/xmpp/XMPPEvents");
var Settings = require("../settings/Settings");
var AuthenticationEvents
= require("../../service/authentication/AuthenticationEvents");
@ -22,18 +21,14 @@ function createExpBackoffTimer(step) {
};
}
function Moderator(roomName, xmpp, emitter) {
function Moderator(roomName, xmpp, emitter, settings) {
this.roomName = roomName;
this.xmppService = xmpp;
this.getNextTimeout = createExpBackoffTimer(1000);
this.getNextErrorTimeout = createExpBackoffTimer(1000);
// External authentication stuff
this.externalAuthEnabled = false;
this.settings = new Settings(roomName);
this.settings = settings;
// Sip gateway can be enabled by configuring Jigasi host in config.js or
// it will be enabled automatically if focus detects the component through
// service discovery.

View File

@ -24,13 +24,14 @@ module.exports = function(XMPP) {
this.connection.addHandler(this.onMute.bind(this),
'http://jitsi.org/jitmeet/audio', 'iq', 'set',null,null);
},
createRoom: function (jid, password, options) {
createRoom: function (jid, password, options, settings) {
var roomJid = Strophe.getBareJidFromJid(jid);
if (this.rooms[roomJid]) {
logger.error("You are already in the room!");
return;
}
this.rooms[roomJid] = new ChatRoom(this.connection, jid, password, XMPP, options);
this.rooms[roomJid] = new ChatRoom(this.connection, jid,
password, XMPP, options, settings);
return this.rooms[roomJid];
},
doLeave: function (jid) {

View File

@ -186,7 +186,7 @@ XMPP.prototype.connect = function (jid, password) {
return this._connect(jid, password);
};
XMPP.prototype.createRoom = function (roomName, options) {
XMPP.prototype.createRoom = function (roomName, options, settings) {
var roomjid = roomName + '@' + this.options.hosts.muc;
if (options.useNicks) {
@ -204,7 +204,7 @@ XMPP.prototype.createRoom = function (roomName, options) {
roomjid += '/' + tmpJid;
}
return this.connection.emuc.createRoom(roomjid, null, options);
return this.connection.emuc.createRoom(roomjid, null, options, settings);
}
XMPP.prototype.addListener = function(type, listener) {

View File

@ -102,6 +102,26 @@ var XMPPEvents = {
/**
* Indicates that phone number changed.
*/
PHONE_NUMBER_CHANGED: "conference.phoneNumberChanged"
PHONE_NUMBER_CHANGED: "conference.phoneNumberChanged",
/**
* Indicates error while create offer call.
*/
CREATE_OFFER_FAILED: "xmpp.create_offer_failed",
/**
* Indicates error while create answer call.
*/
CREATE_ANSWER_FAILED: "xmpp.create_answer_failed",
/**
* Indicates error while set local description.
*/
SET_LOCAL_DESCRIPTION_FAILED: "xmpp.set_local_description_failed",
/**
* Indicates error while set remote description.
*/
SET_REMOTE_DESCRIPTION_FAILED: "xmpp.set_remote_description_failed",
/**
* Indicates error while adding ice candidate.
*/
ADD_ICE_CANDIDATE_FAILED: "xmpp.add_ice_candidate_failed"
};
module.exports = XMPPEvents;