Compare commits

...
Author SHA1 Message Date
Dave Horton 81cd2d4424 bugfix: handle calls with no user in To header 2023-01-22 18:02:00 -05:00
Dave Horton 5e0dc01f5c bump version 2023-01-12 16:19:18 -05:00
Dave Horton ca82f11665 pass displayname in From 2023-01-12 14:36:55 -05:00
4 changed files with 9 additions and 7 deletions
+4 -2
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) => {
+2 -2
View File
@@ -100,7 +100,7 @@ module.exports = (srf, logger) => {
};
const getApplicationForDidAndCarrier = async(req, voip_carrier_sid) => {
const did = normalizeDID(req.calledNumber);
const did = normalizeDID(req.calledNumber) || 'anonymous';
try {
/* straight DID match */
@@ -214,7 +214,7 @@ module.exports = (srf, logger) => {
if (matches.length) {
/* we have one or more matches. Now check for one with a provisioned phone number matching the DID */
const vc_sids = matches.map((m) => `'${m.voip_carrier_sid}'`).join(',');
const did = normalizeDID(req.calledNumber);
const did = normalizeDID(req.calledNumber) || 'anonymous';
const sql = `SELECT * FROM phone_numbers WHERE number = '${did}' AND voip_carrier_sid IN (${vc_sids})`;
logger.debug({matches, sql, did, vc_sids}, 'looking up DID');
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "sbc-inbound",
"version": "v0.7.8",
"version": "v0.7.9",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "sbc-inbound",
"version": "v0.7.8",
"version": "v0.7.9",
"license": "MIT",
"dependencies": {
"@jambonz/db-helpers": "^0.7.3",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "sbc-inbound",
"version": "v0.7.8",
"version": "v0.7.9",
"main": "app.js",
"engines": {
"node": ">= 12.0.0"