From cdd25ca33d83201830a773f9d5b23cdcd9d56140 Mon Sep 17 00:00:00 2001 From: Hoan Luu Huu <110280845+xquanluu@users.noreply.github.com> Date: Mon, 12 Feb 2024 22:13:02 +0700 Subject: [PATCH] Fix/gather timeout (#594) * fix gather verb timeout does not work * wip * wip * wip * wip * fix review comments --- lib/tasks/gather.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/tasks/gather.js b/lib/tasks/gather.js index 80f4d9b1..daf15ffe 100644 --- a/lib/tasks/gather.js +++ b/lib/tasks/gather.js @@ -491,9 +491,8 @@ class TaskGather extends SttTask { this._clearTimer(); this._timeoutTimer = setTimeout(() => { if (this.isContinuousAsr) this._startAsrTimer(); - else if (this.interDigitTimeout <= 0 || - this.digitBuffer.length < this.minDigits || - this.needsStt && this.digitBuffer.length === 0) { + if (this.interDigitTimer) return; // let the inter-digit timer complete + else { this._resolve(this.digitBuffer.length >= this.minDigits ? 'dtmf-num-digits' : 'timeout'); } }, this.timeout);