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
This commit is contained in:
Hoan Luu Huu
2024-11-06 01:48:35 +07:00
committed by GitHub
parent a4b1b22324
commit 0520386a1e

View File

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