further fix for #192, also bug fix for starting with a ws connection and switching to webhooks later in the same call

This commit is contained in:
Dave Horton
2022-12-05 10:53:41 -05:00
parent c728417581
commit 46302703da
3 changed files with 4 additions and 4 deletions

View File

@@ -268,6 +268,7 @@ class TaskGather extends Task {
const {timeout} = opts;
this.timeout = timeout;
this._startTimer();
return true;
}
_onDtmf(cs, ep, evt) {
@@ -439,8 +440,7 @@ class TaskGather extends Task {
if (0 === this.timeout) return;
this._clearTimer();
this._timeoutTimer = setTimeout(() => {
if (this.isContinuousAsr) this._startAsrTimer();
else this._resolve(this.digitBuffer.length >= this.minDigits ? 'dtmf-num-digits' : 'timeout');
this._resolve(this.digitBuffer.length >= this.minDigits ? 'dtmf-num-digits' : 'timeout');
}, this.timeout);
}