From 0520386a1e3795d95c18887560f9c212eff47a99 Mon Sep 17 00:00:00 2001 From: Hoan Luu Huu <110280845+xquanluu@users.noreply.github.com> Date: Wed, 6 Nov 2024 01:48:35 +0700 Subject: [PATCH] fixed dial verb should use calling id from From header (#958) * fixed dial verb should use calling id from From header * fix review comment * wip --- lib/tasks/dial.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/tasks/dial.js b/lib/tasks/dial.js index d9ca0963..4cffb402 100644 --- a/lib/tasks/dial.js +++ b/lib/tasks/dial.js @@ -507,10 +507,13 @@ class TaskDial extends Task { ...this.headers }; + // get calling user from From header + const parsedFrom = req.getParsedHeader('from'); + const fromUri = parseUri(parsedFrom.uri); const opts = { headers: this.headers, proxy: `sip:${sbcAddress}`, - callingNumber: this.callerId || req.callingNumber, + callingNumber: this.callerId || fromUri.user, ...(this.callerName && {callingName: this.callerName}), opusFirst: isOpusFirst(this.cs.ep.remote.sdp) };