Compare commits

...

3 Commits

Author SHA1 Message Date
Dave Horton
ab64d0fc24 fix bug in prev commit 2023-08-02 10:27:21 -04:00
Dave Horton
78337ad55e on rest outdial failure, if remote end closed gracefully don't wait for a reconnection 2023-08-01 12:51:43 -04:00
Dave Horton
d2f4777d10 fix #410 2023-08-01 12:45:25 -04:00
2 changed files with 6 additions and 13 deletions

View File

@@ -258,6 +258,7 @@ router.post('/', async(req, res) => {
sipStatus: err.status,
sipReason: err.reason
});
cs.callGone = true;
}
else {
if (cs) cs.emit('callStatusChange', {

View File

@@ -796,23 +796,15 @@ class CallSession extends Emitter {
}
}
if (0 === this.tasks.length && this.requestor instanceof WsRequestor && !this.callGone) {
//let span;
if (0 === this.tasks.length &&
this.requestor instanceof WsRequestor &&
!this.requestor.closedGracefully &&
!this.callGone
) {
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();
if (this.callGone) break;
} catch (err) {
//span.end();
this.logger.info(err, 'CallSession:exec - error waiting for new commands');
break;
}