diff --git a/lib/tasks/gather.js b/lib/tasks/gather.js index 1224722a..ee219803 100644 --- a/lib/tasks/gather.js +++ b/lib/tasks/gather.js @@ -177,8 +177,10 @@ class TaskGather extends SttTask { this._startVad(); const startDtmfListener = () => { + assert(!this._dtmfListenerStarted); if (this.input.includes('digits') || this.dtmfBargein || this.asrDtmfTerminationDigit) { ep.on('dtmf', this._onDtmf.bind(this, cs, ep)); + this._dtmfListenerStarted = true; } }; @@ -281,7 +283,8 @@ class TaskGather extends SttTask { } } - if (this.listenDuringPrompt) { + // https://github.com/jambonz/jambonz-feature-server/issues/913 + if (this.listenDuringPrompt || (!this.sayTask && !this.playTask)) { startDtmfListener(); }