Browse Source

Added outbound ringer timeout (35s).

pull/238/merge
Simon Eisenmann 9 years ago
parent
commit
0ce04056e6
  1. 12
      static/js/controllers/uicontroller.js

12
static/js/controllers/uicontroller.js

@ -232,6 +232,7 @@ define(['jquery', 'underscore', 'bigscreen', 'moment', 'sjcl', 'modernizr', 'web @@ -232,6 +232,7 @@ define(['jquery', 'underscore', 'bigscreen', 'moment', 'sjcl', 'modernizr', 'web
var pickupTimeout = null;
var autoAcceptTimeout = null;
var ringerTimeout = null;
$scope.updateAutoAccept = function(id, from) {
if (id) {
@ -726,8 +727,19 @@ define(['jquery', 'underscore', 'bigscreen', 'moment', 'sjcl', 'modernizr', 'web @@ -726,8 +727,19 @@ define(['jquery', 'underscore', 'bigscreen', 'moment', 'sjcl', 'modernizr', 'web
$scope.$on("status", function(event, status) {
if (status === "connecting" && dialerEnabled) {
dialer.start();
// Start accept timeout.
ringerTimeout = $timeout(function() {
console.log("Ringer timeout reached.");
mediaStream.webrtc.doHangup("ringertimeout");
$scope.$emit("notification", "pickuptimeout", {
reason: 'pickuptimeout',
from: $scope.dialing
});
}, 35000);
} else {
dialer.stop();
$timeout.cancel(ringerTimeout);
ringerTimeout = null;
}
safeApply($scope, function(scope) {
var old = $scope.status;

Loading…
Cancel
Save