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

View File

@ -322,6 +322,10 @@
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");
self.to = setTimeout(function() {

View File

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

View File

@ -9,5 +9,11 @@
"autologin": "true",
"autocall": "3500",
"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;
}
if (data.wsFallbackURL) {
verto.data.wsFallbackURL = data.wsFallbackURL;
}
if (data.turnServer) {
verto.data.turnServer = data.turnServer;
}
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",
hostname: window.location.hostname,
wsURL: ("wss://" + window.location.hostname + ":8082"),
socketFallbackUrl: null,
turnServer: null,
resCheckEnded: false
};
@ -733,6 +735,8 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora
login: data.login + '@' + data.hostname,
passwd: data.password,
socketUrl: data.wsURL,
socketFallbackUrl: data.socketFallbackUrl,
turnServer: data.turnServer,
tag: "webcam",
ringFile: "sounds/bell_ring2.wav",
audioParams: {