From 259dedcded60a24fbaf86d491f52bf26ee9f11a9 Mon Sep 17 00:00:00 2001 From: Sam Machin Date: Fri, 13 Jun 2025 17:23:40 +0100 Subject: [PATCH] Update dial.js (#1243) --- lib/tasks/dial.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/tasks/dial.js b/lib/tasks/dial.js index b3b4311c..f6a8676a 100644 --- a/lib/tasks/dial.js +++ b/lib/tasks/dial.js @@ -422,9 +422,13 @@ class TaskDial extends Task { } //caller and callee legs are briged together, accept refer with 202 will release callee leg endpoint //that makes freeswitch release endpoint for caller leg. + //if the remaning leg is not a child (the child has now adulted) then hangup the A leg. if (this.ep) this.ep.unbridge(); res.send(202); this.logger.info('DialTask:handleRefer - sent 202 Accepted'); + if (!isChild) { + this.cs._jambonzHangup('refer-completed'); + } } catch (err) { this.logger.info({err}, 'DialTask:handleRefer - error processing incoming REFER'); res.send(err.statusCode || 501);