diff --git a/lib/RTCSession/ReferNotifier.js b/lib/RTCSession/ReferNotifier.js index dcf50712d..2b587ad89 100644 --- a/lib/RTCSession/ReferNotifier.js +++ b/lib/RTCSession/ReferNotifier.js @@ -44,18 +44,23 @@ module.exports = class ReferNotifier state = `active;expires=${this._expires}`; } - // Put this in a try/catch block. - this._session.sendRequest(JsSIP_C.NOTIFY, { - extraHeaders : [ - `Event: ${C.event_type};id=${this._id}`, - `Subscription-State: ${state}`, - `Content-Type: ${C.body_type}` - ], - body : `SIP/2.0 ${code} ${reason}`, - eventHandlers : { - // If a negative response is received, subscription is canceled. - onErrorResponse() { this._active = false; } - } - }); + try + { + this._session.sendRequest(JsSIP_C.NOTIFY, { + extraHeaders : [ + `Event: ${C.event_type};id=${this._id}`, + `Subscription-State: ${state}`, + `Content-Type: ${C.body_type}` + ], + body : `SIP/2.0 ${code} ${reason}`, + eventHandlers : { + // If a negative response is received, subscription is canceled. + onErrorResponse() { this._active = false; } + } + }); + } + catch (e) { + logger.debug('sendRequest exception ignored', e); + } } };