diff --git a/lib/tasks/gather.js b/lib/tasks/gather.js index ab132894..925e14c3 100644 --- a/lib/tasks/gather.js +++ b/lib/tasks/gather.js @@ -390,9 +390,13 @@ class TaskGather extends SttTask { if (this.digitBuffer.length === 0 && this.needsStt) { // DTMF is higher priority than STT. this.removeCustomEventListeners(); + // Fix for https://github.com/jambonz/jambonz-feature-server/issues/1281 + // We should immediately call stop transcription from gather + // so that next gather can start transcription immediately ep.stopTranscription({ vendor: this.vendor, bugname: this.bugname, + gracefulShutdown: false }) .catch((err) => this.logger.error({err}, ` Received DTMF, Error stopping transcription for vendor ${this.vendor}`)); @@ -1236,9 +1240,13 @@ class TaskGather extends SttTask { async _resolve(reason, evt) { this.logger.info({evt}, `TaskGather:resolve with reason ${reason}`); if (this.needsStt && this.ep && this.ep.connected) { + // Fix for https://github.com/jambonz/jambonz-feature-server/issues/1281 + // We should immediately call stop transcription from gather + // so that next gather can start transcription immediately this.ep.stopTranscription({ vendor: this.vendor, - bugname: this.bugname + bugname: this.bugname, + gracefulShutdown: false }) .catch((err) => { if (this.resolved) return;