mirror of
https://github.com/jambonz/sbc-outbound.git
synced 2026-10-04 02:04:19 +00:00
support referby display name (#161)
This commit is contained in:
+3
-5
@@ -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
|
||||
@@ -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'];
|
||||
@@ -1169,7 +1167,7 @@ Duration=${payload.duration} `
|
||||
method: 'REFER',
|
||||
headers: {
|
||||
'Refer-To': `<${stringifyUri(uri)}>`,
|
||||
'Referred-By': `<${stringifyUri(u)}>`,
|
||||
'Referred-By': referredby,
|
||||
...customHeaders
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user