This commit is contained in:
Dave Horton
2020-02-19 14:29:36 -05:00
parent 734ec897e5
commit 3a9dcb8ada
4 changed files with 12 additions and 12 deletions
+5 -5
View File
@@ -20,6 +20,7 @@ class CallSession extends Emitter {
}
async connect() {
this.logger.info('inbound call accepted for routing');
const engine = this.getRtpEngine(this.logger);
if (!engine) {
this.logger.info('No available rtpengines, rejecting call!');
@@ -40,7 +41,7 @@ class CallSession extends Emitter {
this.stats.increment('sbc.terminations', tags);
return this.res.send(480);
}
this.logger.debug(`using feature server ${featureServer}`);
debug(`using feature server ${featureServer}`);
this.rtpEngineOpts = makeRtpEngineOpts(this.req, isWSS(this.req), false);
this.rtpEngineResource = {destroy: this.del.bind(null, this.rtpEngineOpts.common)};
@@ -108,8 +109,7 @@ class CallSession extends Emitter {
});
// successfully connected
this.logger.info('call connected');
debug('call connected');
this.logger.info('call connected successfully to feature server');
this._setHandlers({uas, uac});
return;
} catch (err) {
@@ -119,7 +119,7 @@ class CallSession extends Emitter {
if (err instanceof SipError) {
const tags = ['accepted:no', `sipStatus:${err.status}`, `originator:${this.req.locals.originator}`];
this.stats.increment('sbc.terminations', tags);
this.logger.info(`call failed with ${err.status}`);
this.logger.info(`call failed to connect to feature server with ${err.status}`);
return this.emit('failed');
}
else if (err.message !== 'call canceled') {
@@ -139,7 +139,7 @@ class CallSession extends Emitter {
[uas, uac].forEach((dlg) => {
//hangup
dlg.on('destroy', () => {
this.logger.info('call ended');
this.logger.info('call ended with normal termination');
this.rtpEngineResource.destroy();
this.activeCallIds.delete(this.req.get('Call-ID'));
});
+3 -3
View File
@@ -19,7 +19,7 @@ module.exports = (srf, logger) => {
logger.info(`adding feature server at ${uri}`);
stats.gauge('sbc.featureservers.count', contacts.size + 1);
}
logger.debug(`Feature server at ${uri} has ${calls} calls`);
debug(`Feature server at ${uri} has ${calls} calls`);
contacts.set(uri, {pingTime: new Date(), calls: calls});
}
else {
@@ -55,7 +55,7 @@ module.exports = (srf, logger) => {
});
const keys = [ ...contacts.keys() ];
logger.debug({keys}, `there are ${keys.length} feature servers online`);
debug({keys}, `there are ${keys.length} feature servers online`);
stats.gauge('sbc.featureservers.count', contacts.size);
}, CHECK_INTERVAL * 1000);
}
@@ -74,7 +74,7 @@ module.exports = (srf, logger) => {
const featureServers = [ ...contacts].map((o) => o[0]);
debug({featureServers}, 'selecting feature servers from static list');
selectedUri = featureServers[idx++ % featureServers.length];
logger.debug(`selected ${selectedUri}`);
debug(`selected ${selectedUri}`);
}
return selectedUri;
};
+3 -3
View File
@@ -1847,9 +1847,9 @@
}
},
"jambonz-rtpengine-utils": {
"version": "0.0.9",
"resolved": "https://registry.npmjs.org/jambonz-rtpengine-utils/-/jambonz-rtpengine-utils-0.0.9.tgz",
"integrity": "sha512-G1d0ZHv5n5cYat0weDtgXyxrkXtZXg5GhSNCt9ekv2S1Yox3afzPdENLcL9eqltytHoBU/kJTnMQR7+8BTjFTQ==",
"version": "0.0.10",
"resolved": "https://registry.npmjs.org/jambonz-rtpengine-utils/-/jambonz-rtpengine-utils-0.0.10.tgz",
"integrity": "sha512-rG/vb3QjTVYK1RTELP9rQMGtNkMdTil/iZTY0Pz3xM3qx1brmA6Fh03wY6xUUbRo8ixK+R380ztmy9r+qhiOfA==",
"requires": {
"debug": "^4.1.1",
"rtpengine-client": "0.0.9"
+1 -1
View File
@@ -30,7 +30,7 @@
"drachtio-srf": "^4.4.28",
"jambonz-db-helpers": "^0.3.2",
"jambonz-http-authenticator": "0.1.1",
"jambonz-rtpengine-utils": "0.0.9",
"jambonz-rtpengine-utils": "0.0.10",
"jambonz-stats-collector": "0.0.3",
"pino": "^5.14.0",
"rtpengine-client": "^0.0.8"