From 0dd161913c70b01b05ae030576f23795af3bea5a Mon Sep 17 00:00:00 2001 From: Hoan Luu Huu <110280845+xquanluu@users.noreply.github.com> Date: Sun, 26 Mar 2023 23:32:51 +0700 Subject: [PATCH] fix: gather task should clear dtmf event before resolve (#284) Co-authored-by: Quan HL --- lib/tasks/gather.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/tasks/gather.js b/lib/tasks/gather.js index ab8aa44a..6db19a17 100644 --- a/lib/tasks/gather.js +++ b/lib/tasks/gather.js @@ -788,6 +788,10 @@ class TaskGather extends Task { if (this.resolved) return; this.resolved = true; + // Clear dtmf event + if (this.dtmfBargein) { + this.ep.removeAllListeners('dtmf'); + } clearTimeout(this.interDigitTimer); this._clearTimer();