From c77611f034148c7c346766fb1803efb38034b190 Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Thu, 31 Mar 2022 15:25:20 -0400 Subject: [PATCH] gather: dont send webhook if call is gone --- lib/tasks/gather.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/tasks/gather.js b/lib/tasks/gather.js index 79cc44d2..64cbe468 100644 --- a/lib/tasks/gather.js +++ b/lib/tasks/gather.js @@ -226,6 +226,7 @@ class TaskGather extends Task { if (this.vad?.enable) { opts.START_RECOGNIZING_ON_VAD = 1; if (this.vad.voiceMs) opts.RECOGNIZER_VAD_VOICE_MS = this.vad.voiceMs; + else opts.RECOGNIZER_VAD_VOICE_MS = 125; if (this.vad.mode >= 0 && this.vad.mode <= 3) opts.RECOGNIZER_VAD_MODE = this.vad.mode; } @@ -437,6 +438,8 @@ class TaskGather extends Task { async _resolve(reason, evt) { if (this.resolved) return; + if (this.callSession && this.callSession.callGone) return; + this.resolved = true; this.logger.info(`TaskGather:resolve with reason ${reason}`); clearTimeout(this.interDigitTimer);