mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 16:50:39 +00:00
fix default gather input is digits and gather dtmf should not require speech
This commit is contained in:
@@ -30,6 +30,10 @@ class TaskGather extends SttTask {
|
||||
'speechTimeout', 'timeout', 'say', 'play'
|
||||
].forEach((k) => this[k] = this.data[k]);
|
||||
|
||||
// gather default input is digits
|
||||
if (!this.input) {
|
||||
this.input = ['digits'];
|
||||
}
|
||||
/* when collecting dtmf, bargein on dtmf is true unless explicitly set to false */
|
||||
if (this.dtmfBargein !== false && this.input.includes('digits')) this.dtmfBargein = true;
|
||||
|
||||
|
||||
@@ -110,7 +110,12 @@ class SttTask extends Task {
|
||||
this.data.recognizer.model = cs.speechRecognizerLanguage;
|
||||
}
|
||||
|
||||
if (!this.sttCredentials) {
|
||||
if (
|
||||
// not gather task, such as transcribe
|
||||
(!this.input ||
|
||||
// gather task with speech
|
||||
this.input.includes('speech')) &&
|
||||
!this.sttCredentials) {
|
||||
try {
|
||||
this.sttCredentials = await this._initSpeechCredentials(this.cs, this.vendor, this.label);
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user