From 594c867192911c7cc2c7c8c55bcfc9d9bb81808d Mon Sep 17 00:00:00 2001 From: Hoan Luu Huu <110280845+xquanluu@users.noreply.github.com> Date: Fri, 15 Nov 2024 07:30:49 +0700 Subject: [PATCH] unbridge dial ep with caller ep to avoid media release when referHook (#972) --- lib/tasks/dial.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/tasks/dial.js b/lib/tasks/dial.js index 05bc3c73..a0ae8334 100644 --- a/lib/tasks/dial.js +++ b/lib/tasks/dial.js @@ -381,6 +381,9 @@ class TaskDial extends Task { this.logger.info(err, 'Dial:handleRefer - error setting new application after receiving REFER'); } } + //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 (this.ep) this.ep.unbridge(); res.send(202); this.logger.info('DialTask:handleRefer - sent 202 Accepted'); } catch (err) {