@@ -80,13 +91,14 @@
- {{hhours}}:{{mminutes}}:{{sseconds}}
+ Room {{ extension }} - Canvas {{ canvasID }}
+ {{hhours}}:{{mminutes}}:{{sseconds}}
diff --git a/html5/verto/verto_communicator/src/vertoControllers/controllers/ChatController.js b/html5/verto/verto_communicator/src/vertoControllers/controllers/ChatController.js
index 3129db87c7..99c6359c96 100644
--- a/html5/verto/verto_communicator/src/vertoControllers/controllers/ChatController.js
+++ b/html5/verto/verto_communicator/src/vertoControllers/controllers/ChatController.js
@@ -98,6 +98,11 @@
});
$rootScope.$on('members.del', function(event, uuid) {
+ if ($rootScope.watcher && $rootScope.master === uuid) {
+ verto.hangup();
+ window.close();
+ }
+
$scope.$apply(function() {
var memberIdx = findMemberByUUID(uuid);
if (memberIdx != -1) {
diff --git a/html5/verto/verto_communicator/src/vertoControllers/controllers/DialPadController.js b/html5/verto/verto_communicator/src/vertoControllers/controllers/DialPadController.js
index 305befeea1..305e4e60fb 100644
--- a/html5/verto/verto_communicator/src/vertoControllers/controllers/DialPadController.js
+++ b/html5/verto/verto_communicator/src/vertoControllers/controllers/DialPadController.js
@@ -10,6 +10,15 @@
eventQueue.process();
+ if ($location.search().autocall) {
+ $rootScope.dialpadNumber = $location.search().autocall;
+ delete $location.search().autocall;
+ call($rootScope.dialpadNumber);
+ if($rootScope.watcher) {
+ return;
+ }
+ }
+
$scope.call_history = CallHistory.all();
$scope.history_control = CallHistory.all_control();
$scope.has_history = Object.keys($scope.call_history).length;
@@ -32,11 +41,6 @@
/**
* fill dialpad via querystring [?autocall=\d+]
*/
- if ($location.search().autocall) {
- $rootScope.dialpadNumber = $location.search().autocall;
- delete $location.search().autocall;
- call($rootScope.dialpadNumber);
- }
/**
* fill in dialpad via config.json
@@ -83,6 +87,13 @@
return false;
}
+ if (extension.indexOf('-canvas-') != -1) {
+ $rootScope.watcher = true;
+ verto.call($rootScope.dialpadNumber, null, { useCamera: false, useMic: false, caller_id_name: null, userVariables: {}, caller_id_number: null, mirrorInput: false });
+ $location.path('/incall');
+ return;
+ }
+
storage.data.mutedVideo = false;
storage.data.mutedMic = false;
diff --git a/html5/verto/verto_communicator/src/vertoControllers/controllers/InCallController.js b/html5/verto/verto_communicator/src/vertoControllers/controllers/InCallController.js
index 93e510d5e3..10887d3195 100644
--- a/html5/verto/verto_communicator/src/vertoControllers/controllers/InCallController.js
+++ b/html5/verto/verto_communicator/src/vertoControllers/controllers/InCallController.js
@@ -15,7 +15,6 @@
$scope.dialpadTemplate = '';
$scope.incall = true;
-
if (storage.data.videoCall) {
$scope.callTemplate = 'partials/video_call.html';
}
@@ -25,6 +24,7 @@
if($scope.chatStatus) {
$scope.openChat();
}
+ buildCanvasesData();
});
});
@@ -80,6 +80,22 @@
$rootScope.$emit('changedSpeaker', speakerId);
};
+ $scope.confPopup = function(canvas_id) {
+ var s = window.location.href;
+ var curCall = verto.data.call.callID;
+ var extension = verto.data.call.params.remote_caller_id_number;
+ var width = 465, height = 360;
+ var x = screen.width/2 - width/2
+ var y = screen.height/2 - height/2
+
+ s = s.replace(/\#.*/, '');
+ s += "#/?sessid=random&master=" + curCall + "&watcher=true&extension=" + extension+ "&canvas_id=" + canvas_id;
+
+ console.log("opening new window to " + s);
+ var popup = window.open(s, "canvas_window_" + canvas_id, "toolbar=0,location=0,menubar=0,directories=0,width=" + width + ",height=" + height, + ',left=' + x + ',top=' + y);
+ popup.moveTo(x, y);
+ };
+
$scope.screenshare = function() {
if(verto.data.shareCall) {
verto.screenshareHangup();
@@ -88,6 +104,14 @@
verto.screenshare(storage.data.called_number);
};
+ function buildCanvasesData() {
+ $scope.conf = verto.data.conf.params.laData;
+ $scope.canvases = [{ id: 1, name: 'Super Canvas' }];
+ for (var i = 1; i < $scope.conf.canvasCount; i++) {
+ $scope.canvases.push({ id: i+1, name: 'Canvas ' + (i+1) });
+ }
+ }
+
$scope.muteMic = verto.muteMic;
$scope.muteVideo = verto.muteVideo;
diff --git a/html5/verto/verto_communicator/src/vertoControllers/controllers/MainController.js b/html5/verto/verto_communicator/src/vertoControllers/controllers/MainController.js
index 3c245301a4..5f965a2a74 100644
--- a/html5/verto/verto_communicator/src/vertoControllers/controllers/MainController.js
+++ b/html5/verto/verto_communicator/src/vertoControllers/controllers/MainController.js
@@ -8,6 +8,24 @@
console.debug('Executing MainController.');
+ $rootScope.master = $location.search().master;
+ if ($location.search().watcher === 'true') {
+ $rootScope.watcher = true;
+ angular.element(document.body).addClass('watcher');
+ var dialpad;
+ var extension = dialpad = $location.search().extension;
+ var canvasID = $location.search().canvas_id;
+
+ if (dialpad) {
+ if (canvasID) {
+ dialpad += '-canvas-' + canvasID;
+ }
+ $rootScope.extension = extension;
+ $rootScope.canvasID = canvasID;
+ $location.search().autocall = dialpad;
+ }
+ }
+
var myVideo = document.getElementById("webcam");
$scope.verto = verto;
$scope.storage = storage;
@@ -432,6 +450,11 @@
return;
}
+ if ($rootScope.watcher) {
+ window.close();
+ return;
+ }
+
//var hangupCallback = function(v, hangup) {
// if (hangup) {
// $location.path('/dialpad');
diff --git a/html5/verto/verto_communicator/src/vertoDirectives/directives/videoTag.js b/html5/verto/verto_communicator/src/vertoDirectives/directives/videoTag.js
index 38b50552f7..e40adc879a 100644
--- a/html5/verto/verto_communicator/src/vertoDirectives/directives/videoTag.js
+++ b/html5/verto/verto_communicator/src/vertoDirectives/directives/videoTag.js
@@ -32,4 +32,4 @@
}
});
-})();
\ No newline at end of file
+})();
diff --git a/html5/verto/verto_communicator/src/vertoService/services/vertoService.js b/html5/verto/verto_communicator/src/vertoService/services/vertoService.js
index 9bf54c3cbd..68ed52c4bc 100644
--- a/html5/verto/verto_communicator/src/vertoService/services/vertoService.js
+++ b/html5/verto/verto_communicator/src/vertoService/services/vertoService.js
@@ -584,6 +584,11 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora
var that = this;
function ourBootstrap() {
+ var sessid = $location.search().sessid;
+ if (sessid === 'random') {
+ sessid = $.verto.genUUID();
+ $location.search().sessid = sessid;
+ }
// Checking if we have a failed connection attempt before
// connecting again.
if (data.instance && !data.instance.rpcClient.socketReady()) {
@@ -604,6 +609,7 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora
googNoiseSuppression: storage.data.googNoiseSuppression || true,
googHighpassFilter: storage.data.googHighpassFilter || true
},
+ sessid: sessid,
iceServers: storage.data.useSTUN
}, callbacks);
@@ -614,6 +620,7 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora
jQuery.verto.unloadJobs.push(function() {
that.reloaded = true;
});
+
data.instance.deviceParams({
useCamera: storage.data.selectedVideo,
useSpeak: storage.data.selectedSpeaker,
@@ -674,10 +681,10 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora
*
* @param callback
*/
- call: function(destination, callback) {
+ call: function(destination, callback, custom) {
console.debug('Attempting to call destination ' + destination + '.');
- var call = data.instance.newCall({
+ var call = data.instance.newCall(angular.extend({
destination_number: destination,
caller_id_name: data.name,
caller_id_number: data.callerid ? data.callerid : data.email,
@@ -694,7 +701,7 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora
email : storage.data.email,
avatar: "http://gravatar.com/avatar/" + md5(storage.data.email) + ".png?s=600"
}
- });
+ }, custom));
data.call = call;