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

6
static/js/mediastream/webrtc.js

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

Loading…
Cancel
Save