From b41c1ffb91effe5351bfa0556f33c81f39e9dc87 Mon Sep 17 00:00:00 2001 From: akirilyuk Date: Tue, 1 Feb 2022 18:39:28 +0100 Subject: [PATCH] change refer to implementation --- lib/tasks/cognigy/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/tasks/cognigy/index.js b/lib/tasks/cognigy/index.js index 91755af5..8963d22d 100644 --- a/lib/tasks/cognigy/index.js +++ b/lib/tasks/cognigy/index.js @@ -198,9 +198,9 @@ class Cognigy extends Task { return say; } - _makeReferTask(number) { + _makeReferTask(referTo) { const refer = makeTask(this.logger, {'sip:refer': { - referTo: number, + referTo, referredBy: 'cognigy' }}); return refer; @@ -282,7 +282,7 @@ class Cognigy extends Task { this._enqueueTask(async() => { this.performAction({cognigyResult: 'hangup Succeeded'}); this.reportedFinalAction = true; - cs.replaceApplication([this._makeReferTask(evt.data.reason)]); + cs.replaceApplication([this._makeHangupTask(evt.data.reason)]); cs.replaceApplication([{hangup: { headers: { 'X-Reason': evt.data.reason @@ -296,7 +296,7 @@ class Cognigy extends Task { this._enqueueTask(async() => { this.performAction({cognigyResult: 'refer succeeded'}); this.reportedFinalAction = true; - cs.replaceApplication([this._makeReferTask(evt.data.number)]); + cs.replaceApplication([this._makeReferTask(evt.data.referTo)]); }); return; default: