From 7c24208067ebc5b67af23e89c3d9d1bb7b43a714 Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Wed, 25 Sep 2024 20:17:22 -0400 Subject: [PATCH] fix #916: race condition where call just ended when action hook play completes (#917) --- lib/utils/action-hook-delay.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/utils/action-hook-delay.js b/lib/utils/action-hook-delay.js index 656f8a8f..35bb26de 100644 --- a/lib/utils/action-hook-delay.js +++ b/lib/utils/action-hook-delay.js @@ -134,7 +134,9 @@ class ActionHookDelayProcessor extends Emitter { this.logger.debug({evt}, 'got playback-start'); if (!this._active) { this.logger.info({evt}, 'ActionHookDelayProcessor#_onNoResponseTimer: killing audio immediately'); - this.ep.api('uuid_break', this.ep.uuid) + + /* note: in race condition we may have just hung up and cs.ep cleared */ + this.ep?.api('uuid_break', this.ep?.uuid) .catch((err) => this.logger.info(err, 'ActionHookDelayProcessor#_onNoResponseTimer Error killing audio')); }