mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-21 09:08:02 +00:00
wip
This commit is contained in:
@@ -796,7 +796,9 @@ class CallSession extends Emitter {
|
||||
}
|
||||
}
|
||||
|
||||
if (0 === this.tasks.length && this.requestor instanceof WsRequestor && !this.callGone) {
|
||||
if (0 === this.tasks.length && ((this.requestor instanceof WsRequestor && !this.callGone) ||
|
||||
// Tasks are all done, but dialog is not establish yet, waiting for cancel/handup the call.
|
||||
!this.dlg)) {
|
||||
//let span;
|
||||
try {
|
||||
//const {span} = this.rootSpan.startChildSpan('waiting for commands');
|
||||
@@ -1790,6 +1792,17 @@ class CallSession extends Emitter {
|
||||
//this.logger.debug(`updating redis with ${JSON.stringify(this.callInfo)}`);
|
||||
this.updateCallStatus(Object.assign({}, this.callInfo.toJSON()), this.serviceUrl)
|
||||
.catch((err) => this.logger.error(err, 'redis error'));
|
||||
|
||||
if (this.wakeupResolver && !this.dlg && this.isCurrentCallHigherThan(CallStatus.Failed)) {
|
||||
// Someone is waiting for call to be final
|
||||
this.wakeupResolver({reason: 'session ended'});
|
||||
this.wakeupResolver = null;
|
||||
}
|
||||
}
|
||||
|
||||
isCurrentCallHigherThan(target) {
|
||||
const obj = Object.values(CallStatus);
|
||||
return obj.indexOf(this.callStatus) >= obj.indexOf(target);
|
||||
}
|
||||
|
||||
async executeStatusCallback(callStatus, sipStatus) {
|
||||
|
||||
@@ -31,11 +31,12 @@
|
||||
},
|
||||
"AllowedSipRecVerbs": ["config", "gather", "transcribe", "listen"],
|
||||
"CallStatus": {
|
||||
"Queued": "queued",
|
||||
"Trying": "trying",
|
||||
"Ringing": "ringing",
|
||||
"EarlyMedia": "early-media",
|
||||
"InProgress": "in-progress",
|
||||
"Queued": "queued",
|
||||
|
||||
"Failed": "failed",
|
||||
"Busy": "busy",
|
||||
"NoAnswer": "no-answer",
|
||||
|
||||
Reference in New Issue
Block a user