pass on displayName of From header if we get it (#82)

* pass on displayName of From header if we get it

* bump version
This commit is contained in:
Dave Horton
2023-03-03 18:55:56 -05:00
committed by GitHub
parent 0c9df878b8
commit d94977169e
3 changed files with 7 additions and 5 deletions

View File

@@ -22,8 +22,10 @@ const MS_TEAMS_SIP_ENDPOINT = 'sip.pstnhub.microsoft.com';
const createBLegFromHeader = (req) => {
const from = req.getParsedHeader('From');
const uri = parseUri(from.uri);
if (uri && uri.user) return `<sip:${uri.user}@localhost>`;
return '<sip:anonymous@localhost>';
const name = from.name;
const displayName = name ? `${name} ` : '';
if (uri && uri.user) return `${displayName}<sip:${uri.user}@localhost>`;
else return `${displayName}<sip:anonymous@localhost>`;
};
const createSiprecBody = (headers, sdp, type, content) => {

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "sbc-inbound",
"version": "v0.8.0",
"version": "v0.8.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "sbc-inbound",
"version": "v0.8.0",
"version": "v0.8.1",
"license": "MIT",
"dependencies": {
"@jambonz/db-helpers": "^0.7.4",

View File

@@ -1,6 +1,6 @@
{
"name": "sbc-inbound",
"version": "v0.8.0",
"version": "v0.8.1",
"main": "app.js",
"engines": {
"node": ">= 12.0.0"