From 077d34dc9e7b05e841fe497f2a03c526263a8083 Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Tue, 5 Apr 2022 08:15:30 -0400 Subject: [PATCH] gather: resolve with reason killed prevented task from ending --- lib/tasks/gather.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/tasks/gather.js b/lib/tasks/gather.js index 8fd2ab3e..dd436933 100644 --- a/lib/tasks/gather.js +++ b/lib/tasks/gather.js @@ -437,11 +437,10 @@ class TaskGather extends Task { } async _resolve(reason, evt) { + this.logger.debug(`TaskGather:resolve with reason ${reason}`); 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); this.span.setAttributes({'stt.resolve': reason, 'stt.result': JSON.stringify(evt)}); @@ -451,6 +450,13 @@ class TaskGather extends Task { } this._clearTimer(); + + if (this.callSession && this.callSession.callGone) { + this.logger.debug('TaskGather:_resolve - call is gone, not invoking web callback'); + this.notifyTaskDone(); + return; + } + if (reason.startsWith('dtmf')) { if (this.parentTask) this.parentTask.emit('dtmf', evt); else {