additional logging

This commit is contained in:
Dave Horton
2021-12-12 09:30:36 -05:00
parent 3d4359fbe4
commit 0663174f46
4 changed files with 53 additions and 39 deletions

View File

@@ -166,6 +166,10 @@ class TaskDial extends Task {
clearTimeout(this.timerMaxCallDuration); clearTimeout(this.timerMaxCallDuration);
this.timerMaxCallDuration = null; this.timerMaxCallDuration = null;
} }
if (this.timerRing) {
clearTimeout(this.timerRing);
this.timerRing = null;
}
this._removeDtmfDetection(cs.dlg); this._removeDtmfDetection(cs.dlg);
this._removeDtmfDetection(this.dlg); this._removeDtmfDetection(this.dlg);
this._killOutdials(); this._killOutdials();
@@ -319,8 +323,9 @@ class TaskDial extends Task {
} }
const ms = await cs.getMS(); const ms = await cs.getMS();
const timerRing = setTimeout(() => { this.timerRing = setTimeout(() => {
this.logger.info(`Dial:_attemptCall: ring no answer timer ${this.timeout}s exceeded`); this.logger.info(`Dial:_attemptCall: ring no answer timer ${this.timeout}s exceeded`);
this.timerRing = null;
this._killOutdials(); this._killOutdials();
}, this.timeout * 1000); }, this.timeout * 1000);
@@ -387,7 +392,8 @@ class TaskDial extends Task {
break; break;
case CallStatus.InProgress: case CallStatus.InProgress:
this.logger.debug('Dial:_attemptCall -- call was answered'); this.logger.debug('Dial:_attemptCall -- call was answered');
clearTimeout(timerRing); clearTimeout(this.timerRing);
this.timerRing = null;
break; break;
case CallStatus.Failed: case CallStatus.Failed:
case CallStatus.Busy: case CallStatus.Busy:
@@ -395,7 +401,8 @@ class TaskDial extends Task {
this.dials.delete(sd.callSid); this.dials.delete(sd.callSid);
if (this.dials.size === 0 && !this.sd) { if (this.dials.size === 0 && !this.sd) {
this.logger.debug('Dial:_attemptCalls - all calls failed after call failure, ending task'); this.logger.debug('Dial:_attemptCalls - all calls failed after call failure, ending task');
clearTimeout(timerRing); clearTimeout(this.timerRing);
this.timerRing = null;
this.kill(cs); this.kill(cs);
} }
break; break;

View File

@@ -20,6 +20,13 @@ function initMS(logger, wrapper, ms) {
wrapper.connects = 1; wrapper.connects = 1;
wrapper.active = true; wrapper.active = true;
}); });
ms.on('channel::open', (evt) => {
logger.debug({evt}, `mediaserver ${ms.address} added endpoint`);
});
ms.on('channel::close', (evt) => {
logger.debug({evt}, `mediaserver ${ms.address} removed endpoint`);
});
} }
function installSrfLocals(srf, logger) { function installSrfLocals(srf, logger) {

68
package-lock.json generated
View File

@@ -1,11 +1,11 @@
{ {
"name": "jambonz-feature-server", "name": "jambonz-feature-server",
"version": "v0.6.7-rc8", "version": "v0.7.0",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"version": "v0.6.7-rc8", "version": "v0.7.0",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@jambonz/db-helpers": "^0.6.14", "@jambonz/db-helpers": "^0.6.14",
@@ -18,7 +18,7 @@
"cidr-matcher": "^2.1.1", "cidr-matcher": "^2.1.1",
"debug": "^4.3.1", "debug": "^4.3.1",
"deepcopy": "^2.1.0", "deepcopy": "^2.1.0",
"drachtio-fsmrf": "^2.0.11", "drachtio-fsmrf": "^2.0.13",
"drachtio-srf": "^4.4.55", "drachtio-srf": "^4.4.55",
"express": "^4.17.1", "express": "^4.17.1",
"ip": "^1.1.5", "ip": "^1.1.5",
@@ -1454,14 +1454,14 @@
} }
}, },
"node_modules/drachtio-fsmrf": { "node_modules/drachtio-fsmrf": {
"version": "2.0.11", "version": "2.0.13",
"resolved": "https://registry.npmjs.org/drachtio-fsmrf/-/drachtio-fsmrf-2.0.11.tgz", "resolved": "https://registry.npmjs.org/drachtio-fsmrf/-/drachtio-fsmrf-2.0.13.tgz",
"integrity": "sha512-3U1tHBh2fJd8cGbUMV+Gc2laq5VxIynmP3Ue0eRW35Za7Sp7/ucPfxbJ2OZc0PlokRCQYGvCyjTdTv8SPzoajQ==", "integrity": "sha512-LYHE/y7d1fBsKltcHmbLLCQ2MNUmJNURkXkAz4BfWZHyavEDGMwrmkrBAMDbOSZV1H87FstdfEzc54Ym1SsQbA==",
"dependencies": { "dependencies": {
"async": "^1.4.2", "async": "^1.4.2",
"debug": "^2.6.9", "debug": "^2.6.9",
"delegates": "^0.1.0", "delegates": "^0.1.0",
"drachtio-modesl": "^1.2.2", "drachtio-modesl": "^1.2.4",
"drachtio-srf": "^4.4.59", "drachtio-srf": "^4.4.59",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"minimist": "^1.2.5", "minimist": "^1.2.5",
@@ -1501,9 +1501,9 @@
} }
}, },
"node_modules/drachtio-modesl": { "node_modules/drachtio-modesl": {
"version": "1.2.2", "version": "1.2.4",
"resolved": "https://registry.npmjs.org/drachtio-modesl/-/drachtio-modesl-1.2.2.tgz", "resolved": "https://registry.npmjs.org/drachtio-modesl/-/drachtio-modesl-1.2.4.tgz",
"integrity": "sha512-4+SVtMahFfqbxP+TIBN0usc9iMJX5Sl/vkJ3lMj3OmIRto18lkUUpFOBbj/PZbFZMoeXLz4tAWNzlzEBCC7bBw==", "integrity": "sha512-Le6/iAuRhJU2fbxuRksXMXPknjU8GN5vpw1p211CmaH/dZxJ5FSghksD9ubV7Kqc6qE73M/K/boDtu14V/GjeQ==",
"dependencies": { "dependencies": {
"debug": "^4.1.1", "debug": "^4.1.1",
"eventemitter2": "^6.4.4", "eventemitter2": "^6.4.4",
@@ -3204,9 +3204,9 @@
} }
}, },
"node_modules/json-schema": { "node_modules/json-schema": {
"version": "0.2.3", "version": "0.4.0",
"resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz",
"integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA=="
}, },
"node_modules/json-schema-traverse": { "node_modules/json-schema-traverse": {
"version": "0.4.1", "version": "0.4.1",
@@ -3234,17 +3234,17 @@
} }
}, },
"node_modules/jsprim": { "node_modules/jsprim": {
"version": "1.4.1", "version": "1.4.2",
"resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz",
"integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==",
"engines": [
"node >=0.6.0"
],
"dependencies": { "dependencies": {
"assert-plus": "1.0.0", "assert-plus": "1.0.0",
"extsprintf": "1.3.0", "extsprintf": "1.3.0",
"json-schema": "0.2.3", "json-schema": "0.4.0",
"verror": "1.10.0" "verror": "1.10.0"
},
"engines": {
"node": ">=0.6.0"
} }
}, },
"node_modules/jwa": { "node_modules/jwa": {
@@ -6353,14 +6353,14 @@
} }
}, },
"drachtio-fsmrf": { "drachtio-fsmrf": {
"version": "2.0.11", "version": "2.0.13",
"resolved": "https://registry.npmjs.org/drachtio-fsmrf/-/drachtio-fsmrf-2.0.11.tgz", "resolved": "https://registry.npmjs.org/drachtio-fsmrf/-/drachtio-fsmrf-2.0.13.tgz",
"integrity": "sha512-3U1tHBh2fJd8cGbUMV+Gc2laq5VxIynmP3Ue0eRW35Za7Sp7/ucPfxbJ2OZc0PlokRCQYGvCyjTdTv8SPzoajQ==", "integrity": "sha512-LYHE/y7d1fBsKltcHmbLLCQ2MNUmJNURkXkAz4BfWZHyavEDGMwrmkrBAMDbOSZV1H87FstdfEzc54Ym1SsQbA==",
"requires": { "requires": {
"async": "^1.4.2", "async": "^1.4.2",
"debug": "^2.6.9", "debug": "^2.6.9",
"delegates": "^0.1.0", "delegates": "^0.1.0",
"drachtio-modesl": "^1.2.2", "drachtio-modesl": "^1.2.4",
"drachtio-srf": "^4.4.59", "drachtio-srf": "^4.4.59",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"minimist": "^1.2.5", "minimist": "^1.2.5",
@@ -6395,9 +6395,9 @@
} }
}, },
"drachtio-modesl": { "drachtio-modesl": {
"version": "1.2.2", "version": "1.2.4",
"resolved": "https://registry.npmjs.org/drachtio-modesl/-/drachtio-modesl-1.2.2.tgz", "resolved": "https://registry.npmjs.org/drachtio-modesl/-/drachtio-modesl-1.2.4.tgz",
"integrity": "sha512-4+SVtMahFfqbxP+TIBN0usc9iMJX5Sl/vkJ3lMj3OmIRto18lkUUpFOBbj/PZbFZMoeXLz4tAWNzlzEBCC7bBw==", "integrity": "sha512-Le6/iAuRhJU2fbxuRksXMXPknjU8GN5vpw1p211CmaH/dZxJ5FSghksD9ubV7Kqc6qE73M/K/boDtu14V/GjeQ==",
"requires": { "requires": {
"debug": "^4.1.1", "debug": "^4.1.1",
"eventemitter2": "^6.4.4", "eventemitter2": "^6.4.4",
@@ -7695,9 +7695,9 @@
} }
}, },
"json-schema": { "json-schema": {
"version": "0.2.3", "version": "0.4.0",
"resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz",
"integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA=="
}, },
"json-schema-traverse": { "json-schema-traverse": {
"version": "0.4.1", "version": "0.4.1",
@@ -7719,13 +7719,13 @@
} }
}, },
"jsprim": { "jsprim": {
"version": "1.4.1", "version": "1.4.2",
"resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz",
"integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==",
"requires": { "requires": {
"assert-plus": "1.0.0", "assert-plus": "1.0.0",
"extsprintf": "1.3.0", "extsprintf": "1.3.0",
"json-schema": "0.2.3", "json-schema": "0.4.0",
"verror": "1.10.0" "verror": "1.10.0"
} }
}, },

View File

@@ -1,6 +1,6 @@
{ {
"name": "jambonz-feature-server", "name": "jambonz-feature-server",
"version": "v0.6.7-rc8", "version": "v0.7.0",
"main": "app.js", "main": "app.js",
"engines": { "engines": {
"node": ">= 10.16.0" "node": ">= 10.16.0"
@@ -36,7 +36,7 @@
"cidr-matcher": "^2.1.1", "cidr-matcher": "^2.1.1",
"debug": "^4.3.1", "debug": "^4.3.1",
"deepcopy": "^2.1.0", "deepcopy": "^2.1.0",
"drachtio-fsmrf": "^2.0.11", "drachtio-fsmrf": "^2.0.13",
"drachtio-srf": "^4.4.55", "drachtio-srf": "^4.4.55",
"express": "^4.17.1", "express": "^4.17.1",
"ip": "^1.1.5", "ip": "^1.1.5",