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;
}
_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: