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