Compare commits

..
10 Commits
7 changed files with 35 additions and 16 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
FROM --platform=linux/amd64 node:18.9.0-alpine3.16 as base
FROM --platform=linux/amd64 node:18.12.1-alpine3.16 as base
RUN apk --update --no-cache add --virtual .builds-deps build-base python3
-1
View File
@@ -184,7 +184,6 @@ if ('test' !== process.env.NODE_ENV) {
}
const lookupRtpServiceEndpoints = (lookup, serviceName) => {
logger.debug(`dns lookup for ${serviceName}..`);
lookup(serviceName, {family: 4, all: true}, (err, addresses) => {
if (err) {
logger.error({err}, `Error looking up ${serviceName}`);
+5 -1
View File
@@ -40,11 +40,13 @@ const initCdr = (srf, req) => {
const to = arr ? arr[1] : req.calledNumber;
arr = regex.exec(req.callingNumber);
const from = arr ? arr[1] : req.callingNumber;
const applicationSid = req.get('X-Application-Sid');
return {
account_sid: req.get('X-Account-Sid'),
call_sid: req.get('X-Call-Sid'),
sip_callid: req.get('Call-ID'),
...(applicationSid && {application_sid: applicationSid}),
from,
to,
duration: 0,
@@ -429,6 +431,7 @@ class CallSession extends Emitter {
sip_status: status
}).catch((err) => this.logger.error({err}, 'Error writing cdr for call failure'));
}
return;
}
else {
this.logger.info(`got ${err.status}, cranking back to next destination`);
@@ -587,7 +590,8 @@ Duration=${payload.duration} `
direction,
sdp: req.body,
};
if (reason && opts.flags && !opts.flags.includes('reset')) opts.flags.push('reset');
// DH: this was restarting ICE, which we don't want to do
//if (reason && opts.flags && !opts.flags.includes('reset')) opts.flags.push('reset');
let response = await this.offer(opts);
if ('ok' !== response.result) {
+2 -1
View File
@@ -17,7 +17,8 @@ function makeRtpEngineOpts(req, srcIsUsingSrtp, dstIsUsingSrtp, teams = false) {
}
const common = {
'call-id': req.get('Call-ID'),
'replace': ['origin', 'session-connection']
'replace': ['origin', 'session-connection'],
'record call': process.env.JAMBONES_RECORD_ALL_CALLS ? 'yes' : 'no'
};
return {
common,
+24 -9
View File
@@ -1,15 +1,15 @@
{
"name": "sbc-outbound",
"version": "v0.7.7",
"version": "v0.7.8",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "sbc-outbound",
"version": "v0.7.7",
"version": "v0.7.8",
"license": "MIT",
"dependencies": {
"@jambonz/db-helpers": "^0.6.19",
"@jambonz/db-helpers": "^0.7.3",
"@jambonz/http-health-check": "^0.0.1",
"@jambonz/mw-registrar": "0.2.2",
"@jambonz/realtimedb-helpers": "^0.4.35",
@@ -560,13 +560,14 @@
}
},
"node_modules/@jambonz/db-helpers": {
"version": "0.6.19",
"resolved": "https://registry.npmjs.org/@jambonz/db-helpers/-/db-helpers-0.6.19.tgz",
"integrity": "sha512-mR9PqPY4aEoeTtUuZI1+4r+k1BFKoe0Dl9pyeAEvm7KSlRMHCVWbOzVE8WfoifC9dZ9541iW5pseqqip3QMkyw==",
"version": "0.7.3",
"resolved": "https://registry.npmjs.org/@jambonz/db-helpers/-/db-helpers-0.7.3.tgz",
"integrity": "sha512-FXQPnl5AGV3P6RhvdSKfjIOdEXShYe7aKJayJjaPARPTCTGqLTDhV2tfsWirCrpQhn+vanJHAiOyzOTmbDIfzA==",
"dependencies": {
"cidr-matcher": "^2.1.1",
"debug": "^4.3.3",
"mysql2": "^2.3.3",
"node-object-hash": "^2.3.10",
"uuid": "^8.3.2"
}
},
@@ -3763,6 +3764,14 @@
"resolved": "https://registry.npmjs.org/node-noop/-/node-noop-0.0.1.tgz",
"integrity": "sha512-kAUvIRxZyDYFTLqGj+7zqXduG89vtqGmNMt9qDMvYH3H8uNTCOTz5ZN1q2Yg8++fWbzv+ERtYVqaOH42Ag5OpA=="
},
"node_modules/node-object-hash": {
"version": "2.3.10",
"resolved": "https://registry.npmjs.org/node-object-hash/-/node-object-hash-2.3.10.tgz",
"integrity": "sha512-jY5dPJzw6NHd/KPSfPKJ+IHoFS81/tJ43r34ZeNMXGzCOM8jwQDCD12HYayKIB6MuznrnqIYy2e891NA2g0ibA==",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/node-preload": {
"version": "0.2.1",
"integrity": "sha512-RM5oyBy45cLEoHqCeh+MNuFAxO0vTFBLskvQbOKnEE7YTTSN4tbN8QWDIPQ6L+WvKsB/qLEGpYe2ZZ9d4W9OIQ==",
@@ -5942,13 +5951,14 @@
"dev": true
},
"@jambonz/db-helpers": {
"version": "0.6.19",
"resolved": "https://registry.npmjs.org/@jambonz/db-helpers/-/db-helpers-0.6.19.tgz",
"integrity": "sha512-mR9PqPY4aEoeTtUuZI1+4r+k1BFKoe0Dl9pyeAEvm7KSlRMHCVWbOzVE8WfoifC9dZ9541iW5pseqqip3QMkyw==",
"version": "0.7.3",
"resolved": "https://registry.npmjs.org/@jambonz/db-helpers/-/db-helpers-0.7.3.tgz",
"integrity": "sha512-FXQPnl5AGV3P6RhvdSKfjIOdEXShYe7aKJayJjaPARPTCTGqLTDhV2tfsWirCrpQhn+vanJHAiOyzOTmbDIfzA==",
"requires": {
"cidr-matcher": "^2.1.1",
"debug": "^4.3.3",
"mysql2": "^2.3.3",
"node-object-hash": "^2.3.10",
"uuid": "^8.3.2"
}
},
@@ -8375,6 +8385,11 @@
"resolved": "https://registry.npmjs.org/node-noop/-/node-noop-0.0.1.tgz",
"integrity": "sha512-kAUvIRxZyDYFTLqGj+7zqXduG89vtqGmNMt9qDMvYH3H8uNTCOTz5ZN1q2Yg8++fWbzv+ERtYVqaOH42Ag5OpA=="
},
"node-object-hash": {
"version": "2.3.10",
"resolved": "https://registry.npmjs.org/node-object-hash/-/node-object-hash-2.3.10.tgz",
"integrity": "sha512-jY5dPJzw6NHd/KPSfPKJ+IHoFS81/tJ43r34ZeNMXGzCOM8jwQDCD12HYayKIB6MuznrnqIYy2e891NA2g0ibA=="
},
"node-preload": {
"version": "0.2.1",
"integrity": "sha512-RM5oyBy45cLEoHqCeh+MNuFAxO0vTFBLskvQbOKnEE7YTTSN4tbN8QWDIPQ6L+WvKsB/qLEGpYe2ZZ9d4W9OIQ==",
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "sbc-outbound",
"version": "v0.7.7",
"version": "v0.7.8",
"main": "app.js",
"engines": {
"node": ">= 12.0.0"
@@ -27,7 +27,7 @@
"jslint": "eslint app.js lib"
},
"dependencies": {
"@jambonz/db-helpers": "^0.6.19",
"@jambonz/db-helpers": "^0.7.3",
"@jambonz/realtimedb-helpers": "^0.4.35",
"@jambonz/http-health-check": "^0.0.1",
"@jambonz/mw-registrar": "0.2.2",
+1 -1
View File
@@ -84,7 +84,7 @@ test('sbc-outbound tests', async(t) => {
const res = await queryCdrs({account_sid: 'ed649e33-e771-403a-8c99-1780eabbc803'});
//console.log(`cdrs: ${JSON.stringify(res)}`);
t.ok(res.total === 6, 'wrote 6 cdrs');
t.ok(res.total === 5, 'wrote 5 cdrs');
srf.disconnect();
} catch (err) {