From 9478f3a1b8f29c6a5fcf3d020e95437201c1bf8d Mon Sep 17 00:00:00 2001 From: Hoan Luu Huu <110280845+xquanluu@users.noreply.github.com> Date: Wed, 22 Nov 2023 08:09:09 +0700 Subject: [PATCH] fix disable gather timeout if interDigitTimeout enabled. (#538) --- lib/tasks/gather.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/tasks/gather.js b/lib/tasks/gather.js index 43b27d10..8aa1bdc9 100644 --- a/lib/tasks/gather.js +++ b/lib/tasks/gather.js @@ -528,7 +528,9 @@ class TaskGather extends SttTask { this._clearTimer(); this._timeoutTimer = setTimeout(() => { if (this.isContinuousAsr) this._startAsrTimer(); - else this._resolve(this.digitBuffer.length >= this.minDigits ? 'dtmf-num-digits' : 'timeout'); + else if (this.interDigitTimeout <= 0 || this.digitBuffer.length < this.minDigits || this.needsStt) { + this._resolve(this.digitBuffer.length >= this.minDigits ? 'dtmf-num-digits' : 'timeout'); + } }, this.timeout); }