From 6e7521c91c088504205ddde03790841423feaca1 Mon Sep 17 00:00:00 2001 From: rammohan-y <37395033+rammohan-y@users.noreply.github.com> Date: Thu, 17 Jul 2025 20:06:22 +0530 Subject: [PATCH] Fix for issue where we should not delay from gather when JAMBONES_TRANSCRIBE_EP_DESTROY_DELAY_MS is set (#1283) * Fix for issue https://github.com/jambonz/jambonz-feature-server/issues/1281 * Commented the reason for the change --- lib/tasks/gather.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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;