support referby with display name (#186)

* support referby with display name

* update siprec client utils
This commit is contained in:
Hoan Luu Huu
2024-12-11 22:34:54 +07:00
committed by GitHub
parent 1cd526c684
commit a7d6cf5a31
3 changed files with 12 additions and 13 deletions

View File

@@ -998,9 +998,7 @@ Duration=${payload.duration} `
if (!arr) {
/* call transfer requested */
const {gateway} = this.req.locals;
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);
const leaveReferToAlone = req.has('X-Refer-To-Leave-Untouched');
if (leaveReferToAlone) {
this.logger.debug({referTo}, 'passing Refer-To header through untouched');
@@ -1030,7 +1028,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
@@ -1040,7 +1038,7 @@ Duration=${payload.duration} `
method: 'REFER',
headers: {
'Refer-To': `<${stringifyUri(uri)}>`,
'Referred-By': `<${stringifyUri(u)}>`,
'Referred-By': referredby,
...customHeaders
}
});

15
package-lock.json generated
View File

@@ -16,7 +16,7 @@
"@jambonz/http-health-check": "^0.0.1",
"@jambonz/realtimedb-helpers": "^0.8.8",
"@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",
"bent": "^7.3.12",
@@ -1463,9 +1463,10 @@
}
},
"node_modules/@jambonz/siprec-client-utils": {
"version": "0.2.7",
"resolved": "https://registry.npmjs.org/@jambonz/siprec-client-utils/-/siprec-client-utils-0.2.7.tgz",
"integrity": "sha512-VztOToBfXnOphg/y6kO+lBYqoDH7X5Ci0daXT5zQ8v5NnaZw+UwxGeFPX3knIR3r5pmzUld0f2giFOuD4ZOF8w==",
"version": "0.2.9",
"resolved": "https://registry.npmjs.org/@jambonz/siprec-client-utils/-/siprec-client-utils-0.2.9.tgz",
"integrity": "sha512-C/1UOrAvQVG0iwiSMS0MC9VHRjhg3/sOjNna+eEjHjws1SHl8NrKBoDL8uOwLqOM2ccpbqCPH9GJAxo5OnOhww==",
"license": "MIT",
"dependencies": {
"sdp-transform": "^2.14.1",
"uuid": "^8.3.2"
@@ -7955,9 +7956,9 @@
}
},
"@jambonz/siprec-client-utils": {
"version": "0.2.7",
"resolved": "https://registry.npmjs.org/@jambonz/siprec-client-utils/-/siprec-client-utils-0.2.7.tgz",
"integrity": "sha512-VztOToBfXnOphg/y6kO+lBYqoDH7X5Ci0daXT5zQ8v5NnaZw+UwxGeFPX3knIR3r5pmzUld0f2giFOuD4ZOF8w==",
"version": "0.2.9",
"resolved": "https://registry.npmjs.org/@jambonz/siprec-client-utils/-/siprec-client-utils-0.2.9.tgz",
"integrity": "sha512-C/1UOrAvQVG0iwiSMS0MC9VHRjhg3/sOjNna+eEjHjws1SHl8NrKBoDL8uOwLqOM2ccpbqCPH9GJAxo5OnOhww==",
"requires": {
"sdp-transform": "^2.14.1",
"uuid": "^8.3.2"

View File

@@ -30,7 +30,7 @@
"@jambonz/http-health-check": "^0.0.1",
"@jambonz/realtimedb-helpers": "^0.8.8",
"@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",
"@jambonz/digest-utils": "^0.0.5",