From 9515cf2cf2edf248b71cdb1a9fbcf0f747e0f252 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Wed, 22 Feb 2017 16:12:37 +0000 Subject: [PATCH] Only hangup on call errors, not errors on sendEvent --- src/CallHandler.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/CallHandler.js b/src/CallHandler.js index 4d25212c0c..bb46056d19 100644 --- a/src/CallHandler.js +++ b/src/CallHandler.js @@ -100,18 +100,19 @@ function pause(audioId) { function _setCallListeners(call) { 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") { dis.dispatch({ action: 'unknown_device_error', err: err, 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() { _setCallState(undefined, call.roomId, "ended");