Fix/gather timeout (#594)

* fix gather verb timeout does not work

* wip

* wip

* wip

* wip

* fix review comments
This commit is contained in:
Hoan Luu Huu
2024-02-12 22:13:02 +07:00
committed by GitHub
parent ef2306e558
commit cdd25ca33d

View File

@@ -491,9 +491,8 @@ class TaskGather extends SttTask {
this._clearTimer(); this._clearTimer();
this._timeoutTimer = setTimeout(() => { this._timeoutTimer = setTimeout(() => {
if (this.isContinuousAsr) this._startAsrTimer(); if (this.isContinuousAsr) this._startAsrTimer();
else if (this.interDigitTimeout <= 0 || if (this.interDigitTimer) return; // let the inter-digit timer complete
this.digitBuffer.length < this.minDigits || else {
this.needsStt && this.digitBuffer.length === 0) {
this._resolve(this.digitBuffer.length >= this.minDigits ? 'dtmf-num-digits' : 'timeout'); this._resolve(this.digitBuffer.length >= this.minDigits ? 'dtmf-num-digits' : 'timeout');
} }
}, this.timeout); }, this.timeout);