console.log('Google+ Login Failure');
});
- $rootScope.callActive = function(data) {
+ $rootScope.callActive = function(data, params) {
verto.data.mutedMic = storage.data.mutedMic;
verto.data.mutedVideo = storage.data.mutedVideo;
storage.data.calling = false;
storage.data.cur_call = 1;
+
+ $location.path('/incall');
+
+ if(params.useVideo) {
+ $rootScope.$emit('call.video', 'video');
+ }
};
- $rootScope.$on('call.active', function(event, data) {
- $rootScope.callActive(data);
+ $rootScope.$on('call.active', function(event, data, params) {
+ $rootScope.callActive(data, params);
});
$rootScope.$on('call.calling', function(event, data) {
if (!verto.data.call) {
toastr.warning('There is no call to hangup.');
$location.path('/dialpad');
+ return;
}
//var hangupCallback = function(v, hangup) {
if (verto.data.shareCall) {
verto.screenshareHangup();
}
+
verto.hangup();
+
+ $location.path('/dialpad');
};
$scope.answerCall = function() {
verto.data.call.answer({
useStereo: storage.data.useStereo,
useCamera: storage.data.selectedVideo,
+ useVideo: storage.data.useVideo,
useMic: storage.data.useMic,
callee_id_name: verto.data.name,
callee_id_number: verto.data.login
$rootScope.$emit('page.incall', 'call');
}
- function callActive(last_state) {
- $rootScope.$emit('call.active', last_state);
+ function callActive(last_state, params) {
+ $rootScope.$emit('call.active', last_state, params);
}
function calling() {
});
break;
default:
+ console.warn('Got a not implemented message:', msg, dialog, params);
break;
}
},
onDialogState: function(d) {
if (!data.call) {
data.call = d;
- if (d.state.name !== 'ringing') {
- inCall();
- }
+
}
console.debug('onDialogState:', d);
case "active":
console.debug('Talking to:', d.cidString());
data.callState = 'active';
- callActive(d.lastState.name);
+ callActive(d.lastState.name, d.params);
break;
case "hangup":
console.debug('Call ended with cause: ' + d.cause);
cleanCall();
}
break;
+ default:
+ console.warn('Got a not implemented state:', d);
+ break;
}
},