diff --git a/lib/tasks/gather.js b/lib/tasks/gather.js index 57796d78..f801e6da 100644 --- a/lib/tasks/gather.js +++ b/lib/tasks/gather.js @@ -23,10 +23,8 @@ 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 - // to a user without listening after the say task has finished + this.logger.debug({opts}, 'created gather task'); - this.listenAfterSpeech = typeof this.data.listenAfterSpeech === "boolean" ? this.data.listenAfterSpeech : true; this.timeout = (this.timeout || 15) * 1000; this.interim = this.partialResultCallback || this.bargein; if (this.data.recognizer) { @@ -54,6 +52,12 @@ class TaskGather extends Task { if (this.say) this.sayTask = makeTask(this.logger, {say: this.say}, this); if (this.play) this.playTask = makeTask(this.logger, {play: this.play}, this); + if(this.sayTask || this.playTask){ + // 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.listenAfterSpeech = typeof this.data.listenAfterSpeech === "boolean" ? this.data.listenAfterSpeech : true; + } + this.parentTask = parentTask; }