From db6f56a0687fb3de991d1c0851a2303d0bf49bb6 Mon Sep 17 00:00:00 2001 From: akirilyuk Date: Tue, 1 Feb 2022 13:06:57 +0100 Subject: [PATCH] kill task after hangup or refer --- lib/tasks/cognigy/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/tasks/cognigy/index.js b/lib/tasks/cognigy/index.js index 9c61ab7a..ef5e6cb0 100644 --- a/lib/tasks/cognigy/index.js +++ b/lib/tasks/cognigy/index.js @@ -223,12 +223,14 @@ class Cognigy extends Task { this.performAction({cognigyResult: 'hangup Succeeded'}); this.reportedFinalAction = true; this.notifyTaskDone(); + this.kill(cs); return; case 'refer': await this._makeReferTask(evt.data.number); this.performAction({cognigyResult: 'refer succeeded'}); this.reportedFinalAction = true; this.notifyTaskDone(); + this.kill(cs); return; default: break;