mirror of
https://github.com/jambonz/sbc-outbound.git
synced 2026-07-04 19:32:04 +00:00
only track service provider calls if JAMBONES_TRACK_SP_CALLS is set
This commit is contained in:
+3
-3
@@ -134,9 +134,9 @@ module.exports = (srf, logger, opts) => {
|
||||
return req.srf.endSession(req);
|
||||
}
|
||||
}
|
||||
if (process.env.JAMBONES_TRACK_ACCOUNT_CALLS) {
|
||||
else if (process.env.JAMBONES_TRACK_ACCOUNT_CALLS || process.env.JAMBONES_TRACK_SP_CALLS) {
|
||||
const {account_limit, sp_limit} = await queryCallLimits(service_provider_sid, account_sid);
|
||||
if (account_limit > 0 && calls > account_limit) {
|
||||
if (process.env.JAMBONES_TRACK_ACCOUNT_CALLS && account_limit > 0 && calls > account_limit) {
|
||||
logger.info({calls, account_limit}, 'checkLimits: account limits exceeded');
|
||||
writeAlerts({
|
||||
alert_type: AlertType.ACCOUNT_CALL_LIMIT,
|
||||
@@ -152,7 +152,7 @@ module.exports = (srf, logger, opts) => {
|
||||
});
|
||||
return req.srf.endSession(req);
|
||||
}
|
||||
if (sp_limit > 0 && callsSP > sp_limit) {
|
||||
if (process.env.JAMBONES_TRACK_SP_CALLS && sp_limit > 0 && callsSP > sp_limit) {
|
||||
logger.info({callsSP, sp_limit}, 'checkLimits: service provider limits exceeded');
|
||||
writeAlerts({
|
||||
alert_type: AlertType.SP_CALL_LIMIT,
|
||||
|
||||
Reference in New Issue
Block a user