Compare commits

...
9 Commits
7 changed files with 20 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,
+9 -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.7.2",
"@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,9 +560,9 @@
}
},
"node_modules/@jambonz/db-helpers": {
"version": "0.7.2",
"resolved": "https://registry.npmjs.org/@jambonz/db-helpers/-/db-helpers-0.7.2.tgz",
"integrity": "sha512-xFK6qNz4HebbNZsR35UnNptxeNKvfzu67UTdkVkBKOXW4O0nsVjwl5yuiacgXugHyCJ6Xq0dB3Cir4e52DAp6A==",
"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",
@@ -5951,9 +5951,9 @@
"dev": true
},
"@jambonz/db-helpers": {
"version": "0.7.2",
"resolved": "https://registry.npmjs.org/@jambonz/db-helpers/-/db-helpers-0.7.2.tgz",
"integrity": "sha512-xFK6qNz4HebbNZsR35UnNptxeNKvfzu67UTdkVkBKOXW4O0nsVjwl5yuiacgXugHyCJ6Xq0dB3Cir4e52DAp6A==",
"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",
+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.7.2",
"@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) {