Skip to content

Commit

Permalink
support referby display name
Browse files Browse the repository at this point in the history
  • Loading branch information
xquanluu committed Dec 11, 2024
1 parent c762acc commit 857d67f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
8 changes: 3 additions & 5 deletions lib/call-session.js
Original file line number Diff line number Diff line change
Expand Up @@ -1146,7 +1146,7 @@ Duration=${payload.duration} `
// eslint-disable-next-line no-unused-vars
const { via, from, to, 'call-id': callid, cseq, 'max-forwards': maxforwards,
// eslint-disable-next-line no-unused-vars
'content-length': _contentlength, 'refer-to': _referto, 'referred-by': _referredby,
'content-length': _contentlength, 'refer-to': _referto, 'referred-by': referredby,
// eslint-disable-next-line no-unused-vars
'X-Refer-To-Leave-Untouched': _leave,
...customHeaders
Expand All @@ -1158,9 +1158,7 @@ Duration=${payload.duration} `
const arr = /context-(.*)/.exec(uri.user);
if (!arr) {
/* call transfer requested */
const referredBy = req.getParsedHeader('Referred-By');
if (!referredBy) return res.send(400);
const u = parseUri(referredBy.uri);
if (!req.has('Referred-By')) return res.send(400);

/* delete contact if it was there from feature server */
delete customHeaders['contact'];
Expand All @@ -1169,7 +1167,7 @@ Duration=${payload.duration} `
method: 'REFER',
headers: {
'Refer-To': `<${stringifyUri(uri)}>`,
'Referred-By': `<${stringifyUri(u)}>`,
'Referred-By': referredby,
...customHeaders
}
});
Expand Down
9 changes: 5 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@jambonz/http-health-check": "^0.0.1",
"@jambonz/mw-registrar": "0.2.7",
"@jambonz/rtpengine-utils": "^0.4.4",
"@jambonz/siprec-client-utils": "^0.2.7",
"@jambonz/siprec-client-utils": "^0.2.9",
"@jambonz/stats-collector": "^0.1.10",
"@jambonz/time-series": "^0.2.10",
"cidr-matcher": "^2.1.1",
Expand Down

0 comments on commit 857d67f

Please sign in to comment.