Compare commits

..
Author SHA1 Message Date
Dave Horton 5438f4e147 wip 2025-01-10 19:21:14 -05:00
Dave Horton dd2a4fead5 wip 2025-01-10 19:17:41 -05:00
Dave Horton e706d60c10 wip 2025-01-10 19:15:08 -05:00
Dave Horton 6e892cb48f wip 2025-01-10 19:06:29 -05:00
Dave Horton 53a205db7d wip 2025-01-10 19:05:47 -05:00
8 changed files with 170 additions and 262 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ module.exports = (logger) => {
// listen for SNS lifecycle changes
let lifecycleEmitter = new Emitter();
lifecycleEmitter.dryUpCalls = false;
if (process.env.AWS_SNS_TOPIC_ARN) {
if (process.env.AWS_SNS_TOPIC_ARM) {
(async function() {
try {
+6 -16
View File
@@ -69,17 +69,7 @@ class SnsNotifier extends Emitter {
subscriptionRequestId: this.subscriptionRequestId
}, 'response from SNS SubscribeURL');
const data = await this.describeInstance();
const group = data.AutoScalingGroups.find((group) =>
group.Instances && group.Instances.some((instance) => instance.InstanceId === this.instanceId)
);
if (!group) {
this.logger.error('Current instance not found in any Auto Scaling group', data);
} else {
const instance = group.Instances.find((instance) => instance.InstanceId === this.instanceId);
this.lifecycleState = instance.LifecycleState;
}
this.lifecycleState = data.AutoScalingGroups[0].Instances[0].LifecycleState;
this.emit('SubscriptionConfirmation', {publicIp: this.publicIp});
break;
@@ -147,13 +137,13 @@ class SnsNotifier extends Emitter {
try {
const params = {
Protocol: 'http',
TopicArn: process.env.AWS_SNS_TOPIC_ARN,
TopicArn: process.env.AWS_SNS_TOPIC_ARM,
Endpoint: this.snsEndpoint
};
const response = await snsClient.send(new SubscribeCommand(params));
this.logger.info({response}, `response to SNS subscribe to ${process.env.AWS_SNS_TOPIC_ARN}`);
this.logger.info({response}, `response to SNS subscribe to ${process.env.AWS_SNS_TOPIC_ARM}`);
} catch (err) {
this.logger.error({err}, `Error subscribing to SNS topic arn ${process.env.AWS_SNS_TOPIC_ARN}`);
this.logger.error({err}, `Error subscribing to SNS topic arn ${process.env.AWS_SNS_TOPIC_ARM}`);
}
}
@@ -164,9 +154,9 @@ class SnsNotifier extends Emitter {
SubscriptionArn: this.subscriptionArn
};
const response = await snsClient.send(new UnsubscribeCommand(params));
this.logger.info({response}, `response to SNS unsubscribe to ${process.env.AWS_SNS_TOPIC_ARN}`);
this.logger.info({response}, `response to SNS unsubscribe to ${process.env.AWS_SNS_TOPIC_ARM}`);
} catch (err) {
this.logger.error({err}, `Error unsubscribing to SNS topic arn ${process.env.AWS_SNS_TOPIC_ARN}`);
this.logger.error({err}, `Error unsubscribing to SNS topic arn ${process.env.AWS_SNS_TOPIC_ARM}`);
}
}
+9 -19
View File
@@ -180,8 +180,8 @@ class CallSession extends Emitter {
host = obj.host;
proxy = `sip:${featureServer}`;
}
if (obj.user) uri = `sip:${obj.user}@${host}`;
else uri = `sip:${host}`;
if (obj.user) uri = `${scheme}:${obj.user}@${host}`;
else uri = `${scheme}:${host}`;
this.logger.info(`uri will be: ${uri}, proxy ${proxy}`);
const sendOfferToRtpEngine = async(remoteSdp) => {
@@ -347,16 +347,7 @@ class CallSession extends Emitter {
this.emit('failed');
}
else if (err.message !== 'call canceled') {
const {writeCallCount, writeCallCountSP, writeCallCountApp} = this.req.srf.locals;
this.logger.error(err, 'unexpected error routing inbound call');
nudgeCallCounts(this.req, 'failure', {
service_provider_sid: this.service_provider_sid,
account_sid: this.account_sid,
application_sid: this.application_sid,
callId: this.req.locals.callId
}, this.decrKey, {writeCallCountSP, writeCallCount, writeCallCountApp})
.catch((err) => this.logger.error(err, 'Error decrementing call counts'));
}
this.srf.endSession(this.req);
}
@@ -463,14 +454,15 @@ class CallSession extends Emitter {
if (process.env.JAMBONES_HOSTING || trackingOn) {
const {writeCallCount, writeCallCountSP, writeCallCountApp} = this.req.srf.locals;
if (!this.req.locals.callCountNudged) {
const {callId} = this.req.locals;
this.req.locals.callCountNudged = true;
this.logger.debug('decrementing call count at end of call');
await nudgeCallCounts(this.req, 'complete', {
this.logger.info('decrementing call count at end of call due to normal termination');
await nudgeCallCounts(this.logger, {
service_provider_sid: this.service_provider_sid,
account_sid: this.account_sid,
application_sid: this.application_sid,
callId: this.req.locals.callId
}, this.decrKey, {writeCallCountSP, writeCallCount, writeCallCountApp})
callId
}, this.decrKey, {writeCallCountSP, writeCallCount, writeCallCountApp}, -1)
.catch((err) => this.logger.error(err, 'Error decrementing call counts'));
}
}
@@ -864,8 +856,7 @@ Duration=${payload.duration} `
blockMedia: this.blockMedia,
unblockMedia: this.unblockMedia,
unsubscribe: this.unsubscribe,
headers,
isSipRecCall: Array.isArray(this.req.payload) && this.req.payload.length > 1
headers
}));
try {
this._startRecordingNoAnswerTimer(res);
@@ -1057,7 +1048,7 @@ Duration=${payload.duration} `
// 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, contact: _contact,
'X-Refer-To-Leave-Untouched': _leave,
...customHeaders
} = req.headers;
@@ -1066,7 +1057,6 @@ Duration=${payload.duration} `
headers: {
'Refer-To': `<${stringifyUri(uri)}>`,
'Referred-By': referredby,
'Contact': this.contactHeader,
...customHeaders
}
});
+2 -2
View File
@@ -265,7 +265,7 @@ module.exports = (srf, logger) => {
/* find all carrier entries that have an inbound gateway matching the source IP */
const [gw] = await pp.query(sqlSelectAllGatewaysForSP);
//logger.debug({gw}, `checking gateways for source address ${req.source_address}`);
logger.debug({gw}, `checking gateways for source address ${req.source_address}`);
let matches = gw
.sort((a, b) => b.netmask - a.netmask)
.filter(gatewayMatchesSourceAddress.bind(null, logger, req.source_address))
@@ -283,7 +283,7 @@ module.exports = (srf, logger) => {
if (matches.length > 1) {
matches = [...new Set(matches.map(JSON.stringify))].map(JSON.parse);
}
//logger.debug({matches}, `matches for source address ${req.source_address}`);
logger.debug({matches}, `matches for source address ${req.source_address}`);
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(',');
+28 -35
View File
@@ -35,7 +35,6 @@ module.exports = function(srf, logger) {
const initLocals = (req, res, next) => {
const callId = req.get('Call-ID');
req.locals = req.locals || {callId};
req.locals.nudge = 0;
/* check if forwarded by a proxy that applied an X-Forwarded-For Header */
if (req.has('X-Forwarded-For') || req.has('X-Subspace-Forwarded-For')) {
@@ -249,6 +248,7 @@ module.exports = function(srf, logger) {
};
const checkLimits = async(req, res, next) => {
const {callId} = req.locals;
const trackingOn = process.env.JAMBONES_TRACK_ACCOUNT_CALLS ||
process.env.JAMBONES_TRACK_SP_CALLS ||
process.env.JAMBONES_TRACK_APP_CALLS;
@@ -260,33 +260,29 @@ module.exports = function(srf, logger) {
assert(account_sid);
assert(service_provider_sid);
/* if quick cancel then we are done */
if (req.canceled) {
logger.info('checkLimits: call was immediately canceled, no need to increment call count as we are done');
return;
}
/* decrement count if INVITE is later rejected */
res.once('end', async({status}) => {
if (status > 200) {
nudgeCallCounts(req, 'failure', {
if (status > 200 && !req.locals.callCountNudged) {
req.locals.callCountNudged = true;
logger.debug('decrementing call count due to call rejection');
nudgeCallCounts(logger, {
service_provider_sid,
account_sid,
application_sid,
callId: req.locals.callId
}, decrKey, {writeCallCountSP, writeCallCount, writeCallCountApp})
callId
}, decrKey, {writeCallCountSP, writeCallCount, writeCallCountApp}, -1)
.catch((err) => logger.error(err, 'Error decrementing call counts'));
}
});
try {
/* increment the call count */
const {callsSP, calls} = await nudgeCallCounts(req, 'init', {
const {callsSP, calls} = await nudgeCallCounts(logger, {
service_provider_sid,
account_sid,
application_sid,
callId: req.locals.callId
}, incrKey, {writeCallCountSP, writeCallCount, writeCallCountApp});
callId
}, incrKey, {writeCallCountSP, writeCallCount, writeCallCountApp}, 1);
/* compare to account's limit, though avoid db hit when call count is low */
const minLimit = process.env.MIN_CALL_LIMIT ?
@@ -295,22 +291,24 @@ module.exports = function(srf, logger) {
logger.debug(`checkLimits: call count is now ${calls}, limit is ${minLimit}`);
if (calls <= minLimit) return next();
const accountCapacities = await lookupAccountCapacitiesBySid(account_sid);
const accountLimit = accountCapacities.find((c) => c.category == 'voice_call_session');
if (accountLimit) {
/* check account limit */
const limit_sessions = accountLimit.quantity;
if (calls > limit_sessions) {
debug(`checkLimits: limits exceeded: call count ${calls}, limit ${limit_sessions}`);
logger.info({calls, limit_sessions}, 'checkLimits: limits exceeded');
writeAlerts({
alert_type: AlertType.ACCOUNT_CALL_LIMIT,
service_provider_sid: account.service_provider_sid,
account_sid,
count: limit_sessions
}).catch((err) => logger.info({err}, 'checkLimits: error writing alert'));
res.send(503, 'Maximum Calls In Progress');
return req.srf.endSession(req);
if (process.env.JAMBONES_HOSTING) {
const accountCapacities = await lookupAccountCapacitiesBySid(account_sid);
const accountLimit = accountCapacities.find((c) => c.category == 'voice_call_session');
if (accountLimit) {
/* check account limit */
const limit_sessions = accountLimit.quantity;
if (calls > limit_sessions) {
debug(`checkLimits: limits exceeded: call count ${calls}, limit ${limit_sessions}`);
logger.info({calls, limit_sessions}, 'checkLimits: limits exceeded');
writeAlerts({
alert_type: AlertType.ACCOUNT_CALL_LIMIT,
service_provider_sid: account.service_provider_sid,
account_sid,
count: limit_sessions
}).catch((err) => logger.info({err}, 'checkLimits: error writing alert'));
res.send(503, 'Maximum Calls In Progress');
return req.srf.endSession(req);
}
}
}
else if (trackingOn) {
@@ -331,11 +329,6 @@ module.exports = function(srf, logger) {
});
return req.srf.endSession(req);
}
if (!account_limit && !sp_limit && process.env.JAMBONES_HOSTING) {
logger.info(`checkLimits: no active subscription found for account ${account_sid}, rejecting call`);
res.send(503, 'No Active Subscription');
return req.srf.endSession(req);
}
if (process.env.JAMBONES_TRACK_SP_CALLS && sp_limit > 0 && callsSP > sp_limit) {
logger.info({callsSP, sp_limit}, 'checkLimits: service provider limits exceeded');
writeAlerts({
+30 -96
View File
@@ -117,97 +117,12 @@ const createHealthCheckApp = (port, logger) => {
});
};
/**
* nudgeCallCounts - increment or decrement call counts in redis
*
* current nudge value
* -----------------------------------------
* why | -1 | 0 | 1 |
* -----------------------------------------
* init | no-op | +1 | N/A |
* failure | N/A | -1 | -1 |
* complete| N/A | N/A | -1 |
*
*
*/
const shouldNudge = (why, req) => {
const {nudge, logger} = req.locals;
let modifyCount = false;
const originalNudge = nudge;
switch (why) {
case 'init':
if (nudge === 0) {
// normal case: new call, increment call count
req.locals.nudge = 1;
modifyCount = true;
}
else if (nudge === -1) {
// extremely quick cancel, don't increment call count
req.locals.nudge = 0;
}
else {
logger.info(`shouldNudge: unexpected nudge value ${nudge} for ${why}`);
}
break;
case 'failure':
if (nudge === 1) {
// normal case of call failed for any reason, decrement call count
req.locals.nudge = 0;
modifyCount = true;
}
else if (nudge === 0) {
// very quick failure dont decrement call count
req.locals.nudge = -1;
}
else {
logger.info(`shouldNudge: unexpected nudge value ${nudge} for ${why}`);
}
break;
case 'complete':
if (nudge === 1) {
// normal case of call completed, decrement call count
req.locals.nudge = 0;
modifyCount = true;
}
else {
logger.info(`shouldNudge: unexpected nudge value ${nudge} for ${why}`);
}
break;
default:
logger.info(`shouldNudge: unexpected why value ${why}`);
break;
}
logger.info(`shouldNudge: '${why}': updating count: ${modifyCount}, nudge: ${originalNudge} -> ${req.locals.nudge}`);
return modifyCount;
};
const nudgeCallCounts = async(req, why, sids, nudgeOperator, writers) => {
const {logger} = req.locals;
const {service_provider_sid, account_sid, application_sid, callId} = sids;
const {writeCallCount, writeCallCountSP, writeCallCountApp} = writers;
const nudgeCallCounts = async(logger, sids, nudgeOperator, writers, direction) => {
const { service_provider_sid, account_sid, callId, application_sid } = sids;
const { writeCallCount, writeCallCountSP, writeCallCountApp } = writers;
const nudges = [];
const writes = [];
if (!shouldNudge(why, req)) {
return {callsSP: null, calls: null, callsApp: null};
}
if (process.env.JAMBONES_DEBUG_CALL_COUNTS) {
const {srf} = require('..');
const {addKey, deleteKey} = srf.locals.realtimeDbHelpers;
if (why === 'init') {
// save for 3 days
await addKey(`debug:incalls:${account_sid}:${callId}`, new Date().toISOString(), 259200);
}
else {
await deleteKey(`debug:incalls:${account_sid}:${callId}`);
}
}
if (process.env.JAMBONES_TRACK_SP_CALLS) {
const key = makeSPCallCountKey(service_provider_sid);
nudges.push(nudgeOperator(key));
@@ -234,30 +149,49 @@ const nudgeCallCounts = async(req, why, sids, nudgeOperator, writers) => {
try {
const [callsSP, calls, callsApp] = await Promise.all(nudges);
logger.debug({
logger.info({
calls, callsSP, callsApp,
service_provider_sid, account_sid, application_sid}, 'call counts after adjustment');
service_provider_sid, account_sid, application_sid
}, `call counts after ${direction > 0 ? 'increment' : 'decrement'}`);
//if (process.env.JAMBONES_DEBUG_CALL_COUNTS) {
const {srf} = require('..');
const {addKey, deleteKey} = srf.locals.realtimeDbHelpers;
if (direction > 0) {
// save for 3 days
await addKey(`debug:incalls:${account_sid}:${callId}`, new Date().toISOString(), 259200);
}
else {
await deleteKey(`debug:incalls:${account_sid}:${callId}`);
}
//}
if (process.env.JAMBONES_TRACK_SP_CALLS) {
writes.push(writeCallCountSP({service_provider_sid, calls_in_progress: callsSP}));
writes.push(writeCallCountSP({ service_provider_sid, calls_in_progress: callsSP }));
}
if (process.env.JAMBONES_TRACK_ACCOUNT_CALLS || process.env.JAMBONES_HOSTING) {
writes.push(writeCallCount({service_provider_sid, account_sid, calls_in_progress: calls}));
writes.push(writeCallCount({ service_provider_sid, account_sid, calls_in_progress: calls }));
}
if (process.env.JAMBONES_TRACK_APP_CALLS && application_sid) {
writes.push(writeCallCountApp({service_provider_sid, account_sid, application_sid, calls_in_progress: callsApp}));
writes.push(writeCallCountApp({
service_provider_sid,
account_sid, application_sid,
calls_in_progress: callsApp
}));
}
/* write the call counts to the database */
Promise.all(writes).catch((err) => logger.error({err}, 'Error writing call counts'));
Promise.all(writes).catch((err) => logger.error({ err }, 'Error writing call counts'));
return {callsSP, calls, callsApp};
return { callsSP, calls, callsApp };
} catch (err) {
logger.error(err, 'error incrementing call counts');
}
return {callsSP: null, calls: null, callsApp: null};
return { callsSP: null, calls: null, callsApp: null };
};
const roundTripTime = (startAt) => {
+87 -86
View File
@@ -1,29 +1,29 @@
{
"name": "sbc-inbound",
"version": "0.9.3",
"version": "0.9.2",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "sbc-inbound",
"version": "0.9.3",
"version": "0.9.2",
"license": "MIT",
"dependencies": {
"@aws-sdk/client-auto-scaling": "^3.549.0",
"@aws-sdk/client-sns": "^3.549.0",
"@jambonz/db-helpers": "^0.9.11",
"@jambonz/digest-utils": "^0.0.6",
"@jambonz/db-helpers": "^0.9.7",
"@jambonz/digest-utils": "^0.0.5",
"@jambonz/http-health-check": "^0.0.1",
"@jambonz/realtimedb-helpers": "^0.8.13",
"@jambonz/realtimedb-helpers": "^0.8.8",
"@jambonz/rtpengine-utils": "^0.4.4",
"@jambonz/siprec-client-utils": "^0.2.10",
"@jambonz/siprec-client-utils": "^0.2.9",
"@jambonz/stats-collector": "^0.1.10",
"@jambonz/time-series": "^0.2.10",
"bent": "^7.3.12",
"cidr-matcher": "^2.1.1",
"debug": "^4.3.4",
"drachtio-fn-b2b-sugar": "0.2.1",
"drachtio-srf": "^5.0.5",
"drachtio-fn-b2b-sugar": "0.1.0",
"drachtio-srf": "^4.5.38",
"express": "^4.19.2",
"pino": "^8.20.0",
"verify-aws-sns-signature": "^0.1.0",
@@ -1410,9 +1410,9 @@
}
},
"node_modules/@jambonz/db-helpers": {
"version": "0.9.11",
"resolved": "https://registry.npmjs.org/@jambonz/db-helpers/-/db-helpers-0.9.11.tgz",
"integrity": "sha512-L6xw60J0sYEMlR0EkeqolKbk+g08yvN51V8D0+bBfpTxsJUGgHiYhDgeGeTLU5J1FQCGwmj2RI1AVW5aAu6Q1A==",
"version": "0.9.7",
"resolved": "https://registry.npmjs.org/@jambonz/db-helpers/-/db-helpers-0.9.7.tgz",
"integrity": "sha512-5qN/CJZJXpbMkMn+8gFn8PpQ0ZImZxp1EjKyxLUlmMn+xgjeNb29c3pjeVt/6EQnBB65jAax6TNsVzVIfpvE2w==",
"dependencies": {
"cidr-matcher": "^2.1.1",
"debug": "^4.3.4",
@@ -1422,11 +1422,11 @@
}
},
"node_modules/@jambonz/digest-utils": {
"version": "0.0.6",
"resolved": "https://registry.npmjs.org/@jambonz/digest-utils/-/digest-utils-0.0.6.tgz",
"integrity": "sha512-7ogpe14+Ibh3yLZbi+yoanTL/6HJw3fLEghPB2YXLNh0cyGWcqrpnE8tM9YLhYSLOE14VFanlpiyaKCNX244kQ==",
"license": "MIT",
"version": "0.0.5",
"resolved": "https://registry.npmjs.org/@jambonz/digest-utils/-/digest-utils-0.0.5.tgz",
"integrity": "sha512-x9/ptEnmZTpasiVRHVAabBN7borzj9QScAokr3InpFMulvCLdCvSUYRmsqUna2Kw2lWTIs9D1BQXnQLDDgNHxA==",
"dependencies": {
"bent": "^7.3.12",
"debug": "^4.3.4",
"nonce": "^1.0.4",
"qs": "^6.9.4"
@@ -1444,9 +1444,9 @@
}
},
"node_modules/@jambonz/realtimedb-helpers": {
"version": "0.8.13",
"resolved": "https://registry.npmjs.org/@jambonz/realtimedb-helpers/-/realtimedb-helpers-0.8.13.tgz",
"integrity": "sha512-/7c8kCu/dMSk8CWTYdEv4xU/7+vmVL30VCjtHPRAXVBRIVejAPDf1xK5n0rXwG8Fda1Oa+0TFsymkiRpew8P6w==",
"version": "0.8.8",
"resolved": "https://registry.npmjs.org/@jambonz/realtimedb-helpers/-/realtimedb-helpers-0.8.8.tgz",
"integrity": "sha512-bzVz2EqJ7Gma5ysOh8J8Z1amw7szCBS1RSCLWEhtwPgYt6yWRdjgXbH7wHJ1qbZYYEfetfn7jeEaee8BYnoQlg==",
"dependencies": {
"debug": "^4.3.4",
"ioredis": "^5.3.2"
@@ -1463,9 +1463,9 @@
}
},
"node_modules/@jambonz/siprec-client-utils": {
"version": "0.2.10",
"resolved": "https://registry.npmjs.org/@jambonz/siprec-client-utils/-/siprec-client-utils-0.2.10.tgz",
"integrity": "sha512-Ns7rWK6cXVCr/1IoqPuVg9UKVRZNcs5EMvnhuoPhRD6L0HzLnfB0/BAq29bkHj0sr0bu0dp3hD5B+BnOcJuhaQ==",
"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",
@@ -2686,9 +2686,9 @@
"dev": true
},
"node_modules/cookie": {
"version": "0.7.1",
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz",
"integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==",
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz",
"integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==",
"engines": {
"node": ">= 0.6"
}
@@ -2704,9 +2704,9 @@
"integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ=="
},
"node_modules/cross-spawn": {
"version": "7.0.6",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
"integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
"version": "7.0.3",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
"dev": true,
"dependencies": {
"path-key": "^3.1.0",
@@ -2943,20 +2943,23 @@
}
},
"node_modules/drachtio-fn-b2b-sugar": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/drachtio-fn-b2b-sugar/-/drachtio-fn-b2b-sugar-0.2.1.tgz",
"integrity": "sha512-bMtje8GWVTze+UG6WSGnlUfBaYCuFiApNXl/XxWc+X9uATZiZkV2jIqhf+Y4SY3nS8dZclJIVKd9qwoCa+i+Vw=="
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/drachtio-fn-b2b-sugar/-/drachtio-fn-b2b-sugar-0.1.0.tgz",
"integrity": "sha512-3m5oVLJzXhtrGFAYuMV4BPhnB0f4sEn9+NZSopFOcwBq1f4Z1Pi6NlyfAPg2LgDJfdop5VqGFbcgKJhzkp3dFA==",
"peerDependencies": {
"drachtio-srf": "^4.5.x"
}
},
"node_modules/drachtio-srf": {
"version": "5.0.5",
"resolved": "https://registry.npmjs.org/drachtio-srf/-/drachtio-srf-5.0.5.tgz",
"integrity": "sha512-dKdOf+zonTvk1eVu0IVc4a/Hdah2KspXngAeLQ3NZHdAkjQCJjYQZubVP6ho2QT1pzu8wA3U4M/atL1O99Ujzw==",
"version": "4.5.38",
"resolved": "https://registry.npmjs.org/drachtio-srf/-/drachtio-srf-4.5.38.tgz",
"integrity": "sha512-dEafgn1OPfkc30Gq3JwJBF4Q7O96fsuqMnE2OO1NqRG0DkwworMIPsusWDo0ePbi+NH74rMjLPmVyC/owA0HXg==",
"dependencies": {
"debug": "^3.2.7",
"delegates": "^0.1.0",
"node-noop": "^0.0.1",
"only": "^0.0.2",
"sdp-transform": "^2.15.0",
"sdp-transform": "^2.14.1",
"short-uuid": "^4.2.2",
"sip-methods": "^0.3.0",
"sip-status": "^0.1.0",
@@ -2964,7 +2967,7 @@
"uuid-random": "^1.3.2"
},
"engines": {
"node": ">= 18.x"
"node": ">= 10.x"
}
},
"node_modules/drachtio-srf/node_modules/debug": {
@@ -3422,16 +3425,16 @@
}
},
"node_modules/express": {
"version": "4.21.2",
"resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz",
"integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==",
"version": "4.21.0",
"resolved": "https://registry.npmjs.org/express/-/express-4.21.0.tgz",
"integrity": "sha512-VqcNGcj/Id5ZT1LZ/cfihi3ttTn+NJmkli2eZADigjq29qTlWi/hAQ43t/VLPq8+UX06FCEx3ByOYet6ZFblng==",
"dependencies": {
"accepts": "~1.3.8",
"array-flatten": "1.1.1",
"body-parser": "1.20.3",
"content-disposition": "0.5.4",
"content-type": "~1.0.4",
"cookie": "0.7.1",
"cookie": "0.6.0",
"cookie-signature": "1.0.6",
"debug": "2.6.9",
"depd": "2.0.0",
@@ -3445,7 +3448,7 @@
"methods": "~1.1.2",
"on-finished": "2.4.1",
"parseurl": "~1.3.3",
"path-to-regexp": "0.1.12",
"path-to-regexp": "0.1.10",
"proxy-addr": "~2.0.7",
"qs": "6.13.0",
"range-parser": "~1.2.1",
@@ -3460,10 +3463,6 @@
},
"engines": {
"node": ">= 0.10.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/express"
}
},
"node_modules/express/node_modules/debug": {
@@ -5394,9 +5393,9 @@
"dev": true
},
"node_modules/path-to-regexp": {
"version": "0.1.12",
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz",
"integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ=="
"version": "0.1.10",
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz",
"integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w=="
},
"node_modules/picocolors": {
"version": "1.0.0",
@@ -5822,9 +5821,9 @@
"integrity": "sha512-8I2a3LovHTOpm7NV5yOyO8IHqgVsfK4+UuySrXU8YXkSRX7k6hCV9b3HrkKCr3nMpgj+0bmocaJJWpvp1oc7ZA=="
},
"node_modules/sdp-transform": {
"version": "2.15.0",
"resolved": "https://registry.npmjs.org/sdp-transform/-/sdp-transform-2.15.0.tgz",
"integrity": "sha512-KrOH82c/W+GYQ0LHqtr3caRpM3ITglq3ljGUIb8LTki7ByacJZ9z+piSGiwZDsRyhQbYBOBJgr2k6X4BZXi3Kw==",
"version": "2.14.1",
"resolved": "https://registry.npmjs.org/sdp-transform/-/sdp-transform-2.14.1.tgz",
"integrity": "sha512-RjZyX3nVwJyCuTo5tGPx+PZWkDMCg7oOLpSlhjDdZfwUoNqG1mM8nyj31IGHyaPWXhjbP7cdK3qZ2bmkJ1GzRw==",
"bin": {
"sdp-verify": "checker.js"
}
@@ -7907,9 +7906,9 @@
"dev": true
},
"@jambonz/db-helpers": {
"version": "0.9.11",
"resolved": "https://registry.npmjs.org/@jambonz/db-helpers/-/db-helpers-0.9.11.tgz",
"integrity": "sha512-L6xw60J0sYEMlR0EkeqolKbk+g08yvN51V8D0+bBfpTxsJUGgHiYhDgeGeTLU5J1FQCGwmj2RI1AVW5aAu6Q1A==",
"version": "0.9.7",
"resolved": "https://registry.npmjs.org/@jambonz/db-helpers/-/db-helpers-0.9.7.tgz",
"integrity": "sha512-5qN/CJZJXpbMkMn+8gFn8PpQ0ZImZxp1EjKyxLUlmMn+xgjeNb29c3pjeVt/6EQnBB65jAax6TNsVzVIfpvE2w==",
"requires": {
"cidr-matcher": "^2.1.1",
"debug": "^4.3.4",
@@ -7919,10 +7918,11 @@
}
},
"@jambonz/digest-utils": {
"version": "0.0.6",
"resolved": "https://registry.npmjs.org/@jambonz/digest-utils/-/digest-utils-0.0.6.tgz",
"integrity": "sha512-7ogpe14+Ibh3yLZbi+yoanTL/6HJw3fLEghPB2YXLNh0cyGWcqrpnE8tM9YLhYSLOE14VFanlpiyaKCNX244kQ==",
"version": "0.0.5",
"resolved": "https://registry.npmjs.org/@jambonz/digest-utils/-/digest-utils-0.0.5.tgz",
"integrity": "sha512-x9/ptEnmZTpasiVRHVAabBN7borzj9QScAokr3InpFMulvCLdCvSUYRmsqUna2Kw2lWTIs9D1BQXnQLDDgNHxA==",
"requires": {
"bent": "^7.3.12",
"debug": "^4.3.4",
"nonce": "^1.0.4",
"qs": "^6.9.4"
@@ -7937,9 +7937,9 @@
}
},
"@jambonz/realtimedb-helpers": {
"version": "0.8.13",
"resolved": "https://registry.npmjs.org/@jambonz/realtimedb-helpers/-/realtimedb-helpers-0.8.13.tgz",
"integrity": "sha512-/7c8kCu/dMSk8CWTYdEv4xU/7+vmVL30VCjtHPRAXVBRIVejAPDf1xK5n0rXwG8Fda1Oa+0TFsymkiRpew8P6w==",
"version": "0.8.8",
"resolved": "https://registry.npmjs.org/@jambonz/realtimedb-helpers/-/realtimedb-helpers-0.8.8.tgz",
"integrity": "sha512-bzVz2EqJ7Gma5ysOh8J8Z1amw7szCBS1RSCLWEhtwPgYt6yWRdjgXbH7wHJ1qbZYYEfetfn7jeEaee8BYnoQlg==",
"requires": {
"debug": "^4.3.4",
"ioredis": "^5.3.2"
@@ -7956,9 +7956,9 @@
}
},
"@jambonz/siprec-client-utils": {
"version": "0.2.10",
"resolved": "https://registry.npmjs.org/@jambonz/siprec-client-utils/-/siprec-client-utils-0.2.10.tgz",
"integrity": "sha512-Ns7rWK6cXVCr/1IoqPuVg9UKVRZNcs5EMvnhuoPhRD6L0HzLnfB0/BAq29bkHj0sr0bu0dp3hD5B+BnOcJuhaQ==",
"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"
@@ -8881,9 +8881,9 @@
"dev": true
},
"cookie": {
"version": "0.7.1",
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz",
"integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w=="
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz",
"integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw=="
},
"cookie-signature": {
"version": "1.0.6",
@@ -8896,9 +8896,9 @@
"integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ=="
},
"cross-spawn": {
"version": "7.0.6",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
"integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
"version": "7.0.3",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
"dev": true,
"requires": {
"path-key": "^3.1.0",
@@ -9060,20 +9060,21 @@
}
},
"drachtio-fn-b2b-sugar": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/drachtio-fn-b2b-sugar/-/drachtio-fn-b2b-sugar-0.2.1.tgz",
"integrity": "sha512-bMtje8GWVTze+UG6WSGnlUfBaYCuFiApNXl/XxWc+X9uATZiZkV2jIqhf+Y4SY3nS8dZclJIVKd9qwoCa+i+Vw=="
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/drachtio-fn-b2b-sugar/-/drachtio-fn-b2b-sugar-0.1.0.tgz",
"integrity": "sha512-3m5oVLJzXhtrGFAYuMV4BPhnB0f4sEn9+NZSopFOcwBq1f4Z1Pi6NlyfAPg2LgDJfdop5VqGFbcgKJhzkp3dFA==",
"requires": {}
},
"drachtio-srf": {
"version": "5.0.5",
"resolved": "https://registry.npmjs.org/drachtio-srf/-/drachtio-srf-5.0.5.tgz",
"integrity": "sha512-dKdOf+zonTvk1eVu0IVc4a/Hdah2KspXngAeLQ3NZHdAkjQCJjYQZubVP6ho2QT1pzu8wA3U4M/atL1O99Ujzw==",
"version": "4.5.38",
"resolved": "https://registry.npmjs.org/drachtio-srf/-/drachtio-srf-4.5.38.tgz",
"integrity": "sha512-dEafgn1OPfkc30Gq3JwJBF4Q7O96fsuqMnE2OO1NqRG0DkwworMIPsusWDo0ePbi+NH74rMjLPmVyC/owA0HXg==",
"requires": {
"debug": "^3.2.7",
"delegates": "^0.1.0",
"node-noop": "^0.0.1",
"only": "^0.0.2",
"sdp-transform": "^2.15.0",
"sdp-transform": "^2.14.1",
"short-uuid": "^4.2.2",
"sip-methods": "^0.3.0",
"sip-status": "^0.1.0",
@@ -9435,16 +9436,16 @@
"integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q=="
},
"express": {
"version": "4.21.2",
"resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz",
"integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==",
"version": "4.21.0",
"resolved": "https://registry.npmjs.org/express/-/express-4.21.0.tgz",
"integrity": "sha512-VqcNGcj/Id5ZT1LZ/cfihi3ttTn+NJmkli2eZADigjq29qTlWi/hAQ43t/VLPq8+UX06FCEx3ByOYet6ZFblng==",
"requires": {
"accepts": "~1.3.8",
"array-flatten": "1.1.1",
"body-parser": "1.20.3",
"content-disposition": "0.5.4",
"content-type": "~1.0.4",
"cookie": "0.7.1",
"cookie": "0.6.0",
"cookie-signature": "1.0.6",
"debug": "2.6.9",
"depd": "2.0.0",
@@ -9458,7 +9459,7 @@
"methods": "~1.1.2",
"on-finished": "2.4.1",
"parseurl": "~1.3.3",
"path-to-regexp": "0.1.12",
"path-to-regexp": "0.1.10",
"proxy-addr": "~2.0.7",
"qs": "6.13.0",
"range-parser": "~1.2.1",
@@ -10868,9 +10869,9 @@
"dev": true
},
"path-to-regexp": {
"version": "0.1.12",
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz",
"integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ=="
"version": "0.1.10",
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz",
"integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w=="
},
"picocolors": {
"version": "1.0.0",
@@ -11168,9 +11169,9 @@
"integrity": "sha512-8I2a3LovHTOpm7NV5yOyO8IHqgVsfK4+UuySrXU8YXkSRX7k6hCV9b3HrkKCr3nMpgj+0bmocaJJWpvp1oc7ZA=="
},
"sdp-transform": {
"version": "2.15.0",
"resolved": "https://registry.npmjs.org/sdp-transform/-/sdp-transform-2.15.0.tgz",
"integrity": "sha512-KrOH82c/W+GYQ0LHqtr3caRpM3ITglq3ljGUIb8LTki7ByacJZ9z+piSGiwZDsRyhQbYBOBJgr2k6X4BZXi3Kw=="
"version": "2.14.1",
"resolved": "https://registry.npmjs.org/sdp-transform/-/sdp-transform-2.14.1.tgz",
"integrity": "sha512-RjZyX3nVwJyCuTo5tGPx+PZWkDMCg7oOLpSlhjDdZfwUoNqG1mM8nyj31IGHyaPWXhjbP7cdK3qZ2bmkJ1GzRw=="
},
"semver": {
"version": "7.5.4",
+7 -7
View File
@@ -1,6 +1,6 @@
{
"name": "sbc-inbound",
"version": "0.9.3",
"version": "0.9.2",
"main": "app.js",
"engines": {
"node": ">= 18.0.0"
@@ -26,21 +26,21 @@
"jslint:fix": "npm run jslint --fix"
},
"dependencies": {
"@jambonz/db-helpers": "^0.9.11",
"@jambonz/db-helpers": "^0.9.7",
"@jambonz/http-health-check": "^0.0.1",
"@jambonz/realtimedb-helpers": "^0.8.13",
"@jambonz/realtimedb-helpers": "^0.8.8",
"@jambonz/rtpengine-utils": "^0.4.4",
"@jambonz/siprec-client-utils": "^0.2.10",
"@jambonz/siprec-client-utils": "^0.2.9",
"@jambonz/stats-collector": "^0.1.10",
"@jambonz/time-series": "^0.2.10",
"@jambonz/digest-utils": "^0.0.6",
"@jambonz/digest-utils": "^0.0.5",
"@aws-sdk/client-sns": "^3.549.0",
"@aws-sdk/client-auto-scaling": "^3.549.0",
"bent": "^7.3.12",
"cidr-matcher": "^2.1.1",
"debug": "^4.3.4",
"drachtio-fn-b2b-sugar": "0.2.1",
"drachtio-srf": "^5.0.5",
"drachtio-fn-b2b-sugar": "0.1.0",
"drachtio-srf": "^4.5.38",
"express": "^4.19.2",
"pino": "^8.20.0",
"verify-aws-sns-signature": "^0.1.0",