mirror of
https://github.com/jambonz/sbc-inbound.git
synced 2026-10-04 02:04:22 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cd2fde360d | ||
|
|
e353b751c0 | ||
|
|
53b46f7e51 | ||
|
|
6608286e8c | ||
|
|
6ddfbc9373 | ||
|
|
cd48675499 | ||
|
|
cecdbdccef |
@@ -270,7 +270,7 @@ srf.invite((req, res) => {
|
||||
session.connect();
|
||||
});
|
||||
|
||||
srf.use((req, res, next, err) => {
|
||||
srf.use((err, req, res, next) => {
|
||||
logger.error(err, 'hit top-level error handler');
|
||||
res.send(500);
|
||||
});
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"ICE": "default",
|
||||
"SDES": "off",
|
||||
"flags": ["generate mid", "SDES-no", "port latching"],
|
||||
"rtcp-mux": ["require"]
|
||||
"rtcp-mux": ["offer"]
|
||||
},
|
||||
"teams": {
|
||||
"transport-protocol": "RTP/SAVP",
|
||||
|
||||
+1
-1
@@ -96,7 +96,7 @@ module.exports = [
|
||||
// Variables
|
||||
'no-delete-var': 2,
|
||||
'no-undef': 2,
|
||||
'no-unused-vars': [2, {args: 'none'}],
|
||||
'no-unused-vars': [2, {args: 'none', ignoreRestSiblings: true}],
|
||||
|
||||
// Node.js and CommonJS
|
||||
'no-mixed-requires': 2,
|
||||
|
||||
+5
-1
@@ -109,7 +109,11 @@ class CallSession extends Emitter {
|
||||
|
||||
async connect() {
|
||||
const {sdp} = this.req.locals;
|
||||
const is3pcc = this.req.body?.length === 0;
|
||||
// use the parsed SDP from middleware (req.locals.sdp), not req.body:
|
||||
// for multipart (SIPREC) or IWF-originated bodies req.body may be empty
|
||||
// or not represent the actual offer, which would wrongly send an
|
||||
// SDP-bearing call down the no-offer 3pcc path.
|
||||
const is3pcc = !sdp || sdp.length === 0;
|
||||
this.logger.info(`inbound ${is3pcc ? '3pcc ' : ''}call accepted for routing`);
|
||||
const engine = this.getRtpEngine();
|
||||
if (!engine) {
|
||||
|
||||
+14
-4
@@ -394,8 +394,13 @@ module.exports = (srf, logger) => {
|
||||
}
|
||||
}
|
||||
if (r.length > 1) {
|
||||
logger.info({r},
|
||||
'multiple carriers with the same gateway have the same number provisioned for the same account'
|
||||
const all = r.map(({account_sid, voip_carrier_sid}) => ({account_sid, voip_carrier_sid}));
|
||||
logger.info({
|
||||
number: r[0].number,
|
||||
total: all.length,
|
||||
matches: all.slice(0, 5)
|
||||
},
|
||||
'multiple carriers with the same gateway have the same number provisioned for the same account'
|
||||
+ ' -- cannot determine which one to use');
|
||||
return {
|
||||
fromCarrier: true,
|
||||
@@ -601,8 +606,13 @@ module.exports = (srf, logger) => {
|
||||
}
|
||||
}
|
||||
else if (r.length > 1) {
|
||||
logger.info({r},
|
||||
'multiple accounts have added this carrier with default routing -- cannot determine which to use');
|
||||
const all = r.map(({account_sid, voip_carrier_sid}) => ({account_sid, voip_carrier_sid}));
|
||||
logger.info({
|
||||
number: r[0].number,
|
||||
total: all.length,
|
||||
matches: all.slice(0, 5)
|
||||
},
|
||||
'multiple accounts have added this carrier with default routing -- cannot determine which to use');
|
||||
return {
|
||||
fromCarrier: true,
|
||||
error: 'Multiple accounts are attempting to route the same phone number from the same carrier'
|
||||
|
||||
+2
-1
@@ -130,7 +130,8 @@ module.exports = function(srf, logger) {
|
||||
logger.info('identifyAccount: rejecting call from carrier because DID has not been provisioned');
|
||||
return res.send(404, 'Number Not Provisioned');
|
||||
}
|
||||
logger.info({gateway}, 'identifyAccount: incoming call from gateway');
|
||||
const {register_password, ...gatewayForLog} = gateway;
|
||||
logger.info({gateway: gatewayForLog}, 'identifyAccount: incoming call from gateway');
|
||||
const appSidHeader = req.get('x-application-sid');
|
||||
if (appSidHeader && appSidHeader == application_sid) {
|
||||
logger.info({callId}, 'Loop Detected, x-application-sid header on incoming call matches applicationSid');
|
||||
|
||||
Generated
+17
-30
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "sbc-inbound",
|
||||
"version": "0.9.6",
|
||||
"version": "0.9.7",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "sbc-inbound",
|
||||
"version": "0.9.6",
|
||||
"version": "0.9.7",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@aws-sdk/client-auto-scaling": "^3.549.0",
|
||||
@@ -15,7 +15,7 @@
|
||||
"@jambonz/db-helpers": "^0.9.18",
|
||||
"@jambonz/digest-utils": "^0.0.9",
|
||||
"@jambonz/http-health-check": "^0.0.1",
|
||||
"@jambonz/realtimedb-helpers": "^0.8.18",
|
||||
"@jambonz/realtimedb-helpers": "^0.8.21",
|
||||
"@jambonz/rtpengine-utils": "^0.4.4",
|
||||
"@jambonz/siprec-client-utils": "^0.2.10",
|
||||
"@jambonz/stats-collector": "^0.1.10",
|
||||
@@ -24,7 +24,7 @@
|
||||
"cidr-matcher": "^2.1.1",
|
||||
"debug": "^4.4.3",
|
||||
"drachtio-fn-b2b-sugar": "0.2.1",
|
||||
"drachtio-srf": "^5.0.20",
|
||||
"drachtio-srf": "^5.0.27",
|
||||
"express": "^4.21.2",
|
||||
"pino": "^10.1.0",
|
||||
"verify-aws-sns-signature": "^0.1.0",
|
||||
@@ -1538,9 +1538,10 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@jambonz/realtimedb-helpers": {
|
||||
"version": "0.8.18",
|
||||
"resolved": "https://registry.npmjs.org/@jambonz/realtimedb-helpers/-/realtimedb-helpers-0.8.18.tgz",
|
||||
"integrity": "sha512-PfQRsOy/uKSA0ymRAEmTQnLxc1BZVRQWc+5mClLX6oB6vgvM/6YGgiuv5GSu26OtuKMTtS+RAxlFeT05iH/2rg==",
|
||||
"version": "0.8.21",
|
||||
"resolved": "https://registry.npmjs.org/@jambonz/realtimedb-helpers/-/realtimedb-helpers-0.8.21.tgz",
|
||||
"integrity": "sha512-Zn/Zw14U0L1pB2RlN5i160FwWqphonhQ7p880OzsKOuvg+wmj6qIkxdLjDXo6TSxFPXDHD25s33zfGOT6ZIfsw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"debug": "^4.3.4",
|
||||
"ioredis": "^5.3.2"
|
||||
@@ -3088,9 +3089,9 @@
|
||||
"integrity": "sha512-bMtje8GWVTze+UG6WSGnlUfBaYCuFiApNXl/XxWc+X9uATZiZkV2jIqhf+Y4SY3nS8dZclJIVKd9qwoCa+i+Vw=="
|
||||
},
|
||||
"node_modules/drachtio-srf": {
|
||||
"version": "5.0.20",
|
||||
"resolved": "https://registry.npmjs.org/drachtio-srf/-/drachtio-srf-5.0.20.tgz",
|
||||
"integrity": "sha512-gqWTfqFZhC93TVBaFtRseemmfHPASotMfHhCy/3wQUHZShUl+Zr7Vbq+pLD1kyTNr4/pzpMwEMLd0/6oq/fCtg==",
|
||||
"version": "5.0.27",
|
||||
"resolved": "https://registry.npmjs.org/drachtio-srf/-/drachtio-srf-5.0.27.tgz",
|
||||
"integrity": "sha512-UCNITDPJreCurG5reM2TSmWSbT52azPaNqoc42L4nljy0aVuDt0Am9ExpAy5RfsP8ioxSY2VdSJehr1ARRJL+Q==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"debug": "^4.4.3",
|
||||
@@ -3098,7 +3099,7 @@
|
||||
"node-noop": "^1.0.0",
|
||||
"only": "^0.0.2",
|
||||
"sdp-transform": "^2.15.0",
|
||||
"short-uuid": "^5.2.0",
|
||||
"short-uuid": "^6.0.3",
|
||||
"sip-methods": "^0.3.0",
|
||||
"sip-status": "^0.1.0",
|
||||
"utils-merge": "^1.0.1",
|
||||
@@ -6110,29 +6111,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/short-uuid": {
|
||||
"version": "5.2.0",
|
||||
"resolved": "https://registry.npmjs.org/short-uuid/-/short-uuid-5.2.0.tgz",
|
||||
"integrity": "sha512-296/Nzi4DmANh93iYBwT4NoYRJuHnKEzefrkSagQbTH/A6NTaB68hSPDjm5IlbI5dx9FXdmtqPcj6N5H+CPm6w==",
|
||||
"version": "6.0.3",
|
||||
"resolved": "https://registry.npmjs.org/short-uuid/-/short-uuid-6.0.3.tgz",
|
||||
"integrity": "sha512-UMZ3rYOoid307EqWsPTnoBUSOB51Fi28vUMPigUsSCmbaSvslyf/SlXZWOn4btj8tokhBTBkPFKVKKlIolEG1w==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"any-base": "^1.1.0",
|
||||
"uuid": "^9.0.1"
|
||||
"any-base": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
}
|
||||
},
|
||||
"node_modules/short-uuid/node_modules/uuid": {
|
||||
"version": "9.0.1",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz",
|
||||
"integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==",
|
||||
"funding": [
|
||||
"https://github.com/sponsors/broofa",
|
||||
"https://github.com/sponsors/ctavan"
|
||||
],
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"uuid": "dist/bin/uuid"
|
||||
"node": ">=14.17.0"
|
||||
}
|
||||
},
|
||||
"node_modules/side-channel": {
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "sbc-inbound",
|
||||
"version": "0.9.6",
|
||||
"version": "0.9.7",
|
||||
"main": "app.js",
|
||||
"engines": {
|
||||
"node": ">= 20.0.0"
|
||||
@@ -32,7 +32,7 @@
|
||||
"@jambonz/db-helpers": "^0.9.18",
|
||||
"@jambonz/digest-utils": "^0.0.9",
|
||||
"@jambonz/http-health-check": "^0.0.1",
|
||||
"@jambonz/realtimedb-helpers": "^0.8.18",
|
||||
"@jambonz/realtimedb-helpers": "^0.8.21",
|
||||
"@jambonz/rtpengine-utils": "^0.4.4",
|
||||
"@jambonz/siprec-client-utils": "^0.2.10",
|
||||
"@jambonz/stats-collector": "^0.1.10",
|
||||
@@ -41,7 +41,7 @@
|
||||
"cidr-matcher": "^2.1.1",
|
||||
"debug": "^4.4.3",
|
||||
"drachtio-fn-b2b-sugar": "0.2.1",
|
||||
"drachtio-srf": "^5.0.20",
|
||||
"drachtio-srf": "^5.0.27",
|
||||
"express": "^4.21.2",
|
||||
"pino": "^10.1.0",
|
||||
"verify-aws-sns-signature": "^0.1.0",
|
||||
|
||||
Reference in New Issue
Block a user