From 2b741b7c7e8d70195e43ca0d5b8e51abf641cc60 Mon Sep 17 00:00:00 2001 From: Combrink Date: Tue, 15 Jun 2021 22:41:23 +0200 Subject: [PATCH] Fix invalid state error on DTMF send --- lib/RTCSession.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/RTCSession.js b/lib/RTCSession.js index 2dae2b017..c98bbc56e 100644 --- a/lib/RTCSession.js +++ b/lib/RTCSession.js @@ -961,7 +961,11 @@ module.exports = class RTCSession extends EventEmitter } // Check Session Status. - if (this._status !== C.STATUS_CONFIRMED && this._status !== C.STATUS_WAITING_FOR_ACK) + if ( + this._status !== C.STATUS_CONFIRMED && + this._status !== C.STATUS_WAITING_FOR_ACK && + this._status !== C.STATUS_1XX_RECEIVED + ) { throw new Exceptions.InvalidStateError(this._status); } @@ -1104,7 +1108,11 @@ module.exports = class RTCSession extends EventEmitter logger.debug('sendInfo()'); // Check Session Status. - if (this._status !== C.STATUS_CONFIRMED && this._status !== C.STATUS_WAITING_FOR_ACK) + if ( + this._status !== C.STATUS_CONFIRMED && + this._status !== C.STATUS_WAITING_FOR_ACK && + this._status !== C.STATUS_1XX_RECEIVED + ) { throw new Exceptions.InvalidStateError(this._status); }