change refer to implementation

This commit is contained in:
akirilyuk
2022-02-01 18:39:28 +01:00
parent cc98f40d44
commit b41c1ffb91

View File

@@ -198,9 +198,9 @@ class Cognigy extends Task {
return say; return say;
} }
_makeReferTask(number) { _makeReferTask(referTo) {
const refer = makeTask(this.logger, {'sip:refer': { const refer = makeTask(this.logger, {'sip:refer': {
referTo: number, referTo,
referredBy: 'cognigy' referredBy: 'cognigy'
}}); }});
return refer; return refer;
@@ -282,7 +282,7 @@ class Cognigy extends Task {
this._enqueueTask(async() => { this._enqueueTask(async() => {
this.performAction({cognigyResult: 'hangup Succeeded'}); this.performAction({cognigyResult: 'hangup Succeeded'});
this.reportedFinalAction = true; this.reportedFinalAction = true;
cs.replaceApplication([this._makeReferTask(evt.data.reason)]); cs.replaceApplication([this._makeHangupTask(evt.data.reason)]);
cs.replaceApplication([{hangup: { cs.replaceApplication([{hangup: {
headers: { headers: {
'X-Reason': evt.data.reason 'X-Reason': evt.data.reason
@@ -296,7 +296,7 @@ class Cognigy extends Task {
this._enqueueTask(async() => { this._enqueueTask(async() => {
this.performAction({cognigyResult: 'refer succeeded'}); this.performAction({cognigyResult: 'refer succeeded'});
this.reportedFinalAction = true; this.reportedFinalAction = true;
cs.replaceApplication([this._makeReferTask(evt.data.number)]); cs.replaceApplication([this._makeReferTask(evt.data.referTo)]);
}); });
return; return;
default: default: