From acaadceaa2df3046d5f9ec53ac064130d026c05c Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Wed, 10 Sep 2025 12:23:32 -0400 Subject: [PATCH] fix exception when receiving REFER but dial task ended (#1353) --- lib/session/call-session.js | 2 +- lib/tasks/dial.js | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/session/call-session.js b/lib/session/call-session.js index 489fbdda..22fe1cd6 100644 --- a/lib/session/call-session.js +++ b/lib/session/call-session.js @@ -2681,7 +2681,7 @@ Duration=${duration} ` */ _onRefer(req, res) { const task = this.currentTask; - const sd = task.sd; + const sd = task?.sd; if (task && TaskName.Dial === task.name && sd && task.referHook) { task.handleRefer(this, req, res); } diff --git a/lib/tasks/dial.js b/lib/tasks/dial.js index 65c84120..f6070de9 100644 --- a/lib/tasks/dial.js +++ b/lib/tasks/dial.js @@ -777,6 +777,9 @@ class TaskDial extends Task { this.epOther.api('uuid_break', this.epOther.uuid); this.epOther.bridge(sd.ep); } + else { + this.logger.error('Dial:_connectSingleDial - no other endpoint to bridge!'); + } this.bridged = true; }