From 6f256e6380e4cb278af5dd5ae57460f0da2b2cf1 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 10 Sep 2014 10:32:05 +0100 Subject: [PATCH] reject calls if there's already a call in progress --- webclient/app-controller.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/webclient/app-controller.js b/webclient/app-controller.js index f28da87cc..f8a0d8d35 100644 --- a/webclient/app-controller.js +++ b/webclient/app-controller.js @@ -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;