FS-11211 - [verto_communicator]: Adding turnServer and socketFallbackUrl options.

This commit is contained in:
netoguimaraes 2018-06-28 17:40:34 -03:00
parent 25e9376b29
commit 68e256597a
6 changed files with 39 additions and 10 deletions

View File

@ -430,7 +430,8 @@
offerSDP: { offerSDP: {
type: "offer", type: "offer",
sdp: self.remoteSDP sdp: self.remoteSDP
} },
turnServer: self.options.turnServer
}); });
onStreamSuccess(self, stream); onStreamSuccess(self, stream);
@ -625,6 +626,7 @@
}, },
constraints: self.constraints, constraints: self.constraints,
iceServers: self.options.iceServers, iceServers: self.options.iceServers,
turnServer: self.options.turnServer
}); });
onStreamSuccess(self, stream); onStreamSuccess(self, stream);
@ -674,13 +676,15 @@
function FSRTCPeerConnection(options) { function FSRTCPeerConnection(options) {
var gathering = false, done = false; var gathering = false, done = false;
var config = {}; var config = {};
var default_ice = { var default_ice = [{ urls: ['stun:stun.l.google.com:19302'] }];
urls: ['stun:stun.l.google.com:19302']
}; if (self.options.turnServer) {
default_ice.push(self.options.turnServer)
}
if (options.iceServers) { if (options.iceServers) {
if (typeof(options.iceServers) === "boolean") { if (typeof(options.iceServers) === "boolean") {
config.iceServers = [default_ice]; config.iceServers = default_ice;
} else { } else {
config.iceServers = options.iceServers; config.iceServers = options.iceServers;
} }

View File

@ -322,6 +322,10 @@
self.options.onWSClose(self); self.options.onWSClose(self);
} }
if (self.ws_cnt > 10) {
self.options.socketUrl = self.options.socketFallbackUrl;
}
console.error("Websocket Lost " + self.ws_cnt + " sleep: " + self.ws_sleep + "msec"); console.error("Websocket Lost " + self.ws_cnt + " sleep: " + self.ws_sleep + "msec");
self.to = setTimeout(function() { self.to = setTimeout(function() {

View File

@ -110,6 +110,8 @@
login: verto.options.login, login: verto.options.login,
passwd: verto.options.passwd, passwd: verto.options.passwd,
socketUrl: verto.options.socketUrl, socketUrl: verto.options.socketUrl,
socketFallbackUrl: verto.options.socketFallbackUrl,
turnServer: verto.options.turnServer,
loginParams: verto.options.loginParams, loginParams: verto.options.loginParams,
userVariables: verto.options.userVariables, userVariables: verto.options.userVariables,
sessid: verto.sessid, sessid: verto.sessid,
@ -2076,10 +2078,11 @@
videoParams: dialog.params.videoParams, videoParams: dialog.params.videoParams,
audioParams: verto.options.audioParams, audioParams: verto.options.audioParams,
iceServers: verto.options.iceServers, iceServers: verto.options.iceServers,
screenShare: dialog.screenShare, screenShare: dialog.screenShare,
useCamera: dialog.useCamera, useCamera: dialog.useCamera,
useMic: dialog.useMic, useMic: dialog.useMic,
useSpeak: dialog.useSpeak useSpeak: dialog.useSpeak,
turnServer: verto.options.turnServer
}); });
dialog.rtc.verto = dialog.verto; dialog.rtc.verto = dialog.verto;

View File

@ -9,5 +9,11 @@
"autologin": "true", "autologin": "true",
"autocall": "3500", "autocall": "3500",
"googlelogin": "true", "googlelogin": "true",
"wsURL": "wss://gamma.tollfreegateway.com/wss2" "wsURL": "wss://gamma.tollfreegateway.com/wss2",
"socketFallbackUrl": "wss://gamma.tollfreegateway.com/wss2",
"turnServer": {
"urls": "turn:someturnserver.com:443?transport=tcp",
"credential": "1234",
"username": "username"
}
} }

View File

@ -41,6 +41,14 @@ vertoService.service('config', ['$rootScope', '$http', '$location', 'storage', '
verto.data.googleclientid = data.googleclientid; verto.data.googleclientid = data.googleclientid;
} }
if (data.wsFallbackURL) {
verto.data.wsFallbackURL = data.wsFallbackURL;
}
if (data.turnServer) {
verto.data.turnServer = data.turnServer;
}
angular.extend(verto.data, data); angular.extend(verto.data, data);
/** /**

View File

@ -175,6 +175,8 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora
password: $cookieStore.get('verto_demo_passwd') || "1234", password: $cookieStore.get('verto_demo_passwd') || "1234",
hostname: window.location.hostname, hostname: window.location.hostname,
wsURL: ("wss://" + window.location.hostname + ":8082"), wsURL: ("wss://" + window.location.hostname + ":8082"),
socketFallbackUrl: null,
turnServer: null,
resCheckEnded: false resCheckEnded: false
}; };
@ -733,6 +735,8 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora
login: data.login + '@' + data.hostname, login: data.login + '@' + data.hostname,
passwd: data.password, passwd: data.password,
socketUrl: data.wsURL, socketUrl: data.wsURL,
socketFallbackUrl: data.socketFallbackUrl,
turnServer: data.turnServer,
tag: "webcam", tag: "webcam",
ringFile: "sounds/bell_ring2.wav", ringFile: "sounds/bell_ring2.wav",
audioParams: { audioParams: {