mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-22 01:27:55 +00:00
improve hangup
This commit is contained in:
@@ -196,15 +196,6 @@ class Cognigy extends Task {
|
|||||||
return say;
|
return say;
|
||||||
}
|
}
|
||||||
|
|
||||||
_makeHangupTask(reason) {
|
|
||||||
const hangup = makeTask(this.logger, {hangup: {
|
|
||||||
headers: {
|
|
||||||
'X-REASON': reason
|
|
||||||
}
|
|
||||||
}}, this);
|
|
||||||
return hangup;
|
|
||||||
}
|
|
||||||
|
|
||||||
_makeReferTask(number) {
|
_makeReferTask(number) {
|
||||||
const refer = makeTask(this.logger, {'sip:refer': {
|
const refer = makeTask(this.logger, {'sip:refer': {
|
||||||
referTo: number,
|
referTo: number,
|
||||||
@@ -279,12 +270,15 @@ class Cognigy extends Task {
|
|||||||
switch (evt.data.type) {
|
switch (evt.data.type) {
|
||||||
case 'hangup':
|
case 'hangup':
|
||||||
this._enqueueTask((async() => {
|
this._enqueueTask((async() => {
|
||||||
const hangupTask = this._makeHangupTask(evt.data.reason);
|
|
||||||
await hangupTask.exec(cs, ep, this);
|
|
||||||
this.performAction({cognigyResult: 'hangup Succeeded'});
|
this.performAction({cognigyResult: 'hangup Succeeded'});
|
||||||
this.reportedFinalAction = true;
|
this.reportedFinalAction = true;
|
||||||
this.notifyTaskDone();
|
const hangupTask = this._makeHangupTask(evt.data.reason);
|
||||||
this.kill(cs);
|
await hangupTask.exec(cs, ep, this);
|
||||||
|
cs.replaceApplication([{hangup: {
|
||||||
|
headers: {
|
||||||
|
'X-Reason': evt.data.reason
|
||||||
|
}
|
||||||
|
}}]);
|
||||||
}).bind(this));
|
}).bind(this));
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ class SpeechConfig extends Emitter {
|
|||||||
} else if (playConfig) {
|
} else if (playConfig) {
|
||||||
finalConfig.play = playConfig;
|
finalConfig.play = playConfig;
|
||||||
}
|
}
|
||||||
this.logger.info({finalConfig}, "created gather config");
|
this.logger.info({finalConfig}, 'created gather config');
|
||||||
return finalConfig;
|
return finalConfig;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user