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; }