mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-21 17:17:58 +00:00
more queue fixes
This commit is contained in:
@@ -318,6 +318,7 @@ class CallSession extends Emitter {
|
|||||||
if (0 === this.tasks.length && this.hasStableDialog && this.requestor instanceof WsRequestor) {
|
if (0 === this.tasks.length && this.hasStableDialog && this.requestor instanceof WsRequestor) {
|
||||||
try {
|
try {
|
||||||
await this._awaitCommandsOrHangup();
|
await this._awaitCommandsOrHangup();
|
||||||
|
if (!this.hasStableDialog || this.callGone) break;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.logger.info(err, 'CallSession:exec - error waiting for new commands');
|
this.logger.info(err, 'CallSession:exec - error waiting for new commands');
|
||||||
break;
|
break;
|
||||||
@@ -681,6 +682,7 @@ class CallSession extends Emitter {
|
|||||||
this.logger.info(`CallSession:_onCommand - invalid command ${command}`);
|
this.logger.info(`CallSession:_onCommand - invalid command ${command}`);
|
||||||
}
|
}
|
||||||
if (this.wakeupResolver) {
|
if (this.wakeupResolver) {
|
||||||
|
this.logger.info('CallSession:_onCommand - got commands, waking up..');
|
||||||
this.wakeupResolver();
|
this.wakeupResolver();
|
||||||
this.wakeupResolver = null;
|
this.wakeupResolver = null;
|
||||||
}
|
}
|
||||||
@@ -1103,6 +1105,7 @@ class CallSession extends Emitter {
|
|||||||
_awaitCommandsOrHangup() {
|
_awaitCommandsOrHangup() {
|
||||||
assert(!this.wakeupResolver);
|
assert(!this.wakeupResolver);
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
this.logger.info('_awaitCommandsOrHangup - waiting...');
|
||||||
this.wakeupResolver = resolve;
|
this.wakeupResolver = resolve;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user