mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 08:40:38 +00:00
Fix/rest outdial failure session hangs (#411)
* fix #410 * on rest outdial failure, if remote end closed gracefully don't wait for a reconnection
This commit is contained in:
@@ -258,6 +258,7 @@ router.post('/', async(req, res) => {
|
|||||||
sipStatus: err.status,
|
sipStatus: err.status,
|
||||||
sipReason: err.reason
|
sipReason: err.reason
|
||||||
});
|
});
|
||||||
|
cs.callGone = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (cs) cs.emit('callStatusChange', {
|
if (cs) cs.emit('callStatusChange', {
|
||||||
|
|||||||
@@ -796,23 +796,15 @@ class CallSession extends Emitter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (0 === this.tasks.length && this.requestor instanceof WsRequestor && !this.callGone) {
|
if (0 === this.tasks.length &&
|
||||||
//let span;
|
this.requestor instanceof WsRequestor &&
|
||||||
|
!this.requestor.this.closedGracefully &&
|
||||||
|
!this.callGone
|
||||||
|
) {
|
||||||
try {
|
try {
|
||||||
//const {span} = this.rootSpan.startChildSpan('waiting for commands');
|
|
||||||
//const {reason, queue, command} = await this._awaitCommandsOrHangup();
|
|
||||||
/*
|
|
||||||
span.setAttributes({
|
|
||||||
'completion.reason': reason,
|
|
||||||
'async.request.queue': queue,
|
|
||||||
'async.request.command': command
|
|
||||||
});
|
|
||||||
span.end();
|
|
||||||
*/
|
|
||||||
await this._awaitCommandsOrHangup();
|
await this._awaitCommandsOrHangup();
|
||||||
if (this.callGone) break;
|
if (this.callGone) break;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
//span.end();
|
|
||||||
this.logger.info(err, 'CallSession:exec - error waiting for new commands');
|
this.logger.info(err, 'CallSession:exec - error waiting for new commands');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user