From 5b11b6e40121a523b84e2642bcf203524226838a Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Thu, 24 Feb 2022 14:24:52 -0500 Subject: [PATCH] more queue fixes --- lib/session/call-session.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/session/call-session.js b/lib/session/call-session.js index b7b2e814..b7ca275a 100644 --- a/lib/session/call-session.js +++ b/lib/session/call-session.js @@ -318,6 +318,7 @@ class CallSession extends Emitter { if (0 === this.tasks.length && this.hasStableDialog && this.requestor instanceof WsRequestor) { try { await this._awaitCommandsOrHangup(); + if (!this.hasStableDialog || this.callGone) break; } catch (err) { this.logger.info(err, 'CallSession:exec - error waiting for new commands'); break; @@ -681,6 +682,7 @@ class CallSession extends Emitter { this.logger.info(`CallSession:_onCommand - invalid command ${command}`); } if (this.wakeupResolver) { + this.logger.info('CallSession:_onCommand - got commands, waking up..'); this.wakeupResolver(); this.wakeupResolver = null; } @@ -1103,6 +1105,7 @@ class CallSession extends Emitter { _awaitCommandsOrHangup() { assert(!this.wakeupResolver); return new Promise((resolve, reject) => { + this.logger.info('_awaitCommandsOrHangup - waiting...'); this.wakeupResolver = resolve; }); }