Only hangup on call errors, not errors on sendEvent

pull/21833/head
Luke Barnard 2017-02-22 16:12:37 +00:00
parent c13ff254b1
commit 9515cf2cf2
1 changed files with 6 additions and 5 deletions

View File

@ -100,18 +100,19 @@ function pause(audioId) {
function _setCallListeners(call) { function _setCallListeners(call) {
call.on("error", function(err) { call.on("error", function(err) {
console.error("Call error: %s", err);
console.error(err.stack);
call.hangup();
_setCallState(undefined, call.roomId, "ended");
});
call.on('send_event_error', function(err) {
if (err.name === "UnknownDeviceError") { if (err.name === "UnknownDeviceError") {
dis.dispatch({ dis.dispatch({
action: 'unknown_device_error', action: 'unknown_device_error',
err: err, err: err,
room: MatrixClientPeg.get().getRoom(call.roomId), room: MatrixClientPeg.get().getRoom(call.roomId),
}); });
} else {
console.error("Call error: %s", err);
console.error(err.stack);
} }
call.hangup();
_setCallState(undefined, call.roomId, "ended");
}); });
call.on("hangup", function() { call.on("hangup", function() {
_setCallState(undefined, call.roomId, "ended"); _setCallState(undefined, call.roomId, "ended");