reject calls if there's already a call in progress

pull/10/head
David Baker 2014-09-10 10:32:05 +01:00
parent 2bd4346075
commit 6f256e6380
1 changed files with 4 additions and 0 deletions

View File

@ -131,6 +131,10 @@ angular.module('MatrixWebClientController', ['matrixService', 'mPresence', 'even
$rootScope.$on(matrixPhoneService.INCOMING_CALL_EVENT, function(ngEvent, call) {
console.trace("incoming call");
if ($rootScope.currentCall && $rootScope.currentCall.state != 'ended') {
console.trace("rejecting call because we're already in a call");
call.hangup();
}
call.onError = $scope.onCallError;
call.onHangup = $scope.onCallHangup;
$rootScope.currentCall = call;