Browse Source

Also show a notification that someone called no matter if call was aborted before pickup timeout.

pull/156/head
Simon Eisenmann 11 years ago
parent
commit
79d132b322
  1. 10
      static/js/controllers/mediastreamcontroller.js
  2. 6
      static/js/mediastream/webrtc.js

10
static/js/controllers/mediastreamcontroller.js

@ -663,6 +663,7 @@ define(['jquery', 'underscore', 'angular', 'bigscreen', 'moment', 'sjcl', 'moder
}); });
mediaStream.webrtc.e.on("bye", function(event, reason, from) { mediaStream.webrtc.e.on("bye", function(event, reason, from) {
console.log("received bye", pickupTimeout, reason);
switch (reason) { switch (reason) {
case "busy": case "busy":
console.log("User is busy", reason, from); console.log("User is busy", reason, from);
@ -689,6 +690,13 @@ define(['jquery', 'underscore', 'angular', 'bigscreen', 'moment', 'sjcl', 'moder
console.log("User cannot accept call because of error"); console.log("User cannot accept call because of error");
alertify.dialog.alert(translation._("Oops") + "<br/>" + translation._("User hung up because of error.")); alertify.dialog.alert(translation._("Oops") + "<br/>" + translation._("User hung up because of error."));
break; break;
case "abort":
console.log("Remote call was aborted before we did pick up");
$scope.$emit("notification", "abortbeforepickup", {
reason: reason,
from: from
});
break;
} }
}); });
@ -725,6 +733,8 @@ define(['jquery', 'underscore', 'angular', 'bigscreen', 'moment', 'sjcl', 'moder
case "incomingbusy": case "incomingbusy":
toastr.info(moment().format("llll"), displayName(details.from) + translation._(" tried to call you.")); toastr.info(moment().format("llll"), displayName(details.from) + translation._(" tried to call you."));
break; break;
case "abortbeforepickup":
// Fall through
case "incomingpickuptimeout": case "incomingpickuptimeout":
toastr.info(moment().format("llll"), displayName(details.from) + translation._(" called you.")); toastr.info(moment().format("llll"), displayName(details.from) + translation._(" called you."));
break; break;

6
static/js/mediastream/webrtc.js

@ -151,9 +151,9 @@ function($, _, PeerCall, PeerConference, PeerXfer, PeerScreenshare, UserMedia, u
return; return;
} }
this.msgQueue.unshift([to, data, type, to2, from]); this.msgQueue.unshift([to, data, type, to2, from]);
// create call // Create call.
this.currentcall = this.createCall(from, from, from); this.currentcall = this.createCall(from, from, from);
// delegate next steps to Ui // Delegate next steps to UI.
this.e.triggerHandler("offer", [from, to2, to]); this.e.triggerHandler("offer", [from, to2, to]);
break; break;
case "Bye": case "Bye":
@ -167,6 +167,8 @@ function($, _, PeerCall, PeerConference, PeerXfer, PeerScreenshare, UserMedia, u
} }
console.log("Bye process (started false)"); console.log("Bye process (started false)");
this.doHangup("receivedbye", from); this.doHangup("receivedbye", from);
// Delegate bye to UI.
this.e.triggerHandler("bye", [data.Reason, from, to, to2]);
break; break;
default: default:
this.msgQueue.push([to, data, type, to2, from]); this.msgQueue.push([to, data, type, to2, from]);

Loading…
Cancel
Save