gather: fix bug referencing this.hints which does not exist (hints are part of recognizer object)

This commit is contained in:
Dave Horton
2023-01-30 18:21:36 -05:00
parent 9d07a1354c
commit 86fed4ec90

View File

@@ -39,7 +39,7 @@ class TaskGather extends Task {
this.removeSpeechListeners = removeSpeechListeners; this.removeSpeechListeners = removeSpeechListeners;
[ [
'finishOnKey', 'hints', 'input', 'numDigits', 'minDigits', 'maxDigits', 'finishOnKey', 'input', 'numDigits', 'minDigits', 'maxDigits',
'interDigitTimeout', 'partialResultHook', 'bargein', 'dtmfBargein', 'interDigitTimeout', 'partialResultHook', 'bargein', 'dtmfBargein',
'speechTimeout', 'timeout', 'say', 'play' 'speechTimeout', 'timeout', 'say', 'play'
].forEach((k) => this[k] = this.data[k]); ].forEach((k) => this[k] = this.data[k]);
@@ -141,9 +141,9 @@ class TaskGather extends Task {
asrDtmfTerminationDigit: this.asrDtmfTerminationDigit asrDtmfTerminationDigit: this.asrDtmfTerminationDigit
}, 'Gather:exec - enabling continuous ASR since it is turned on for the session'); }, 'Gather:exec - enabling continuous ASR since it is turned on for the session');
} }
if (process.env.JAMBONZ_GATHER_EARLY_HINTS_MATCH && if (process.env.JAMBONZ_GATHER_EARLY_HINTS_MATCH && this.needsStt &&
!this.isContinuousAsr && !this.isContinuousAsr &&
this.hints.length > 0 && this.hints.length <= 10) { this.data.recognizer?.hints?.length > 0 && this.data.recognizer?.hints?.length <= 10) {
this.earlyHintsMatch = true; this.earlyHintsMatch = true;
this.interim = true; this.interim = true;
this.logger.debug('Gather:exec - early hints match enabled'); this.logger.debug('Gather:exec - early hints match enabled');