mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-21 17:17:58 +00:00
improve var naming
This commit is contained in:
@@ -23,9 +23,9 @@ class TaskGather extends Task {
|
||||
].forEach((k) => this[k] = this.data[k]);
|
||||
this.listenDuringPrompt = this.data.listenDuringPrompt === false ? false : true;
|
||||
this.minBargeinWordCount = this.data.minBargeinWordCount || 1;
|
||||
// this is specially for barge in where we want to make a bargebale promt
|
||||
// this is specially for barge in where we want to make a bargebale promt
|
||||
// to a user without listening after the say task has finished
|
||||
this.dontListenAfterSpeech = this.data.dontListenAfterSpeech === true;
|
||||
this.listenAfterSpeech = this.data.listenAfterSpeech === false;
|
||||
this.timeout = (this.timeout || 15) * 1000;
|
||||
this.interim = this.partialResultCallback || this.bargein;
|
||||
if (this.data.recognizer) {
|
||||
@@ -104,15 +104,27 @@ class TaskGather extends Task {
|
||||
this.sayTask.on('playDone', async(err) => {
|
||||
if (err) return this.logger.error({err}, 'Gather:exec Error playing tts');
|
||||
this.logger.debug('Gather: say task completed');
|
||||
if (!this.killed || !this.dontListenAfterSpeech) startListening(cs, ep);
|
||||
if (!this.killed) {
|
||||
if (this.listenAfterSpeech) {
|
||||
startListening(cs, ep);
|
||||
} else {
|
||||
this.kill(cs);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
else if (this.playTask) {
|
||||
this.playTask.exec(cs, ep); // kicked off, _not_ waiting for it to complete
|
||||
this.playTask.on('playDone', async(err) => {
|
||||
if (err) return this.logger.error({err}, 'Gather:exec Error playing url');
|
||||
if (!this.killed || !this.dontListenAfterSpeech) startListening(cs, ep);
|
||||
});
|
||||
if (!this.killed) {
|
||||
if (this.listenAfterSpeech) {
|
||||
startListening(cs, ep);
|
||||
} else {
|
||||
this.kill(cs);
|
||||
}
|
||||
}}
|
||||
);
|
||||
}
|
||||
else startListening(cs, ep);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user