mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-21 17:17:58 +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;
|
//let span;
|
||||||
try {
|
try {
|
||||||
//const {span} = this.rootSpan.startChildSpan('waiting for commands');
|
//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.logger.debug(`updating redis with ${JSON.stringify(this.callInfo)}`);
|
||||||
this.updateCallStatus(Object.assign({}, this.callInfo.toJSON()), this.serviceUrl)
|
this.updateCallStatus(Object.assign({}, this.callInfo.toJSON()), this.serviceUrl)
|
||||||
.catch((err) => this.logger.error(err, 'redis error'));
|
.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) {
|
async executeStatusCallback(callStatus, sipStatus) {
|
||||||
|
|||||||
@@ -31,11 +31,12 @@
|
|||||||
},
|
},
|
||||||
"AllowedSipRecVerbs": ["config", "gather", "transcribe", "listen"],
|
"AllowedSipRecVerbs": ["config", "gather", "transcribe", "listen"],
|
||||||
"CallStatus": {
|
"CallStatus": {
|
||||||
|
"Queued": "queued",
|
||||||
"Trying": "trying",
|
"Trying": "trying",
|
||||||
"Ringing": "ringing",
|
"Ringing": "ringing",
|
||||||
"EarlyMedia": "early-media",
|
"EarlyMedia": "early-media",
|
||||||
"InProgress": "in-progress",
|
"InProgress": "in-progress",
|
||||||
"Queued": "queued",
|
|
||||||
"Failed": "failed",
|
"Failed": "failed",
|
||||||
"Busy": "busy",
|
"Busy": "busy",
|
||||||
"NoAnswer": "no-answer",
|
"NoAnswer": "no-answer",
|
||||||
|
|||||||
Reference in New Issue
Block a user