From 9412790366540d1bded17701c0f7d07bed256ebc Mon Sep 17 00:00:00 2001 From: Markus Frindt Date: Thu, 15 Feb 2024 15:44:56 +0100 Subject: [PATCH] add fix to lint script (#124) Co-authored-by: Markus Frindt --- lib/call-session.js | 13 ++++++++++++- package.json | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/call-session.js b/lib/call-session.js index 1c36006..de9d0cd 100644 --- a/lib/call-session.js +++ b/lib/call-session.js @@ -958,6 +958,16 @@ Duration=${payload.duration} ` async _onFeatureServerTransfer(dlg, req, res) { try { + // the following properties are ignored in the REFER headers + // 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, + // eslint-disable-next-line no-unused-vars + 'X-Refer-To-Leave-Untouched': _leave, + ...customHeaders + } = req.headers; + const referTo = req.getParsedHeader('Refer-To'); const uri = parseUri(referTo.uri); this.logger.info({uri, referTo}, 'received REFER from feature server'); @@ -975,7 +985,8 @@ Duration=${payload.duration} ` method: 'REFER', headers: { 'Refer-To': stringifyUri(uri), - 'Referred-By': stringifyUri(u) + 'Referred-By': stringifyUri(u), + ...customHeaders } }); return res.send(response.status); diff --git a/package.json b/package.json index 45c7508..80706a7 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "start": "node app", "test": "NODE_ENV=test HTTP_PORT=3050 JAMBONES_HOSTING=1 JAMBONES_NETWORK_CIDR=127.0.0.1/32 JAMBONES_MYSQL_HOST=127.0.0.1 JAMBONES_MYSQL_USER=jambones_test JAMBONES_MYSQL_PASSWORD=jambones_test JAMBONES_MYSQL_DATABASE=jambones_test JAMBONES_REDIS_HOST=localhost JAMBONES_REDIS_PORT=16379 JAMBONES_TIME_SERIES_HOST=127.0.0.1 JAMBONES_LOGLEVEL=error DRACHTIO_SECRET=cymru DRACHTIO_HOST=127.0.0.1 DRACHTIO_PORT=9060 JAMBONES_RTPENGINES=127.0.0.1:12222 node test/ ", "coverage": "./node_modules/.bin/nyc --reporter html --report-dir ./coverage npm run test", - "jslint": "eslint app.js lib" + "jslint": "eslint app.js lib --fix" }, "dependencies": { "@jambonz/db-helpers": "^0.9.3",