FS-7509: add userVariables parser to initial connection all variables set in this obj will be set on every inbound call

This commit is contained in:
Anthony Minessale
2015-04-25 10:57:09 -05:00
committed by Michael Jerris
parent d3a5605ab6
commit 5ab557fd51
4 changed files with 50 additions and 14 deletions

View File

@@ -65,14 +65,15 @@
$.JsonRpcClient = function(options) {
var self = this;
this.options = $.extend({
ajaxUrl : null,
socketUrl : null, ///< The ws-url for default getSocket.
onmessage : null, ///< Other onmessage-handler.
login : null, /// auth login
passwd : null, /// auth passwd
sessid : null,
loginParams : null,
getSocket : function(onmessage_cb) { return self._getSocket(onmessage_cb); }
ajaxUrl : null,
socketUrl : null, ///< The ws-url for default getSocket.
onmessage : null, ///< Other onmessage-handler.
login : null, /// auth login
passwd : null, /// auth passwd
sessid : null,
loginParams : null,
userVariables : null,
getSocket : function(onmessage_cb) { return self._getSocket(onmessage_cb); }
}, options);
self.ws_cnt = 0;
@@ -263,6 +264,7 @@
self.options.login = params.login;
self.options.passwd = params.passwd;
self.options.loginParams = params.loginParams;
self.options.userVariables = params.userVariables;
};
$.JsonRpcClient.prototype.connectSocket = function(onmessage_cb) {
@@ -422,7 +424,8 @@
if (!self.authing && response.error.code == -32000 && self.options.login && self.options.passwd) {
self.authing = true;
this.call("login", { login: self.options.login, passwd: self.options.passwd, loginParams: self.options.loginParams},
this.call("login", { login: self.options.login, passwd: self.options.passwd, loginParams: self.options.loginParams,
userVariables: self.options.userVariables},
this._ws_callbacks[response.id].request_obj.method == "login" ?
function(e) {
self.authing = false;

View File

@@ -76,6 +76,7 @@
videoParams: {},
audioParams: {},
loginParams: {},
userVariables: {},
iceServers: false,
ringSleep: 6000
}, options);
@@ -94,6 +95,7 @@
passwd: verto.options.passwd,
socketUrl: verto.options.socketUrl,
loginParams: verto.options.loginParams,
userVariables: verto.options.userVariables,
sessid: verto.sessid,
onmessage: function(e) {
return verto.handleMessage(e.eventData);