mirror of
https://github.com/jambonz/sbc-inbound.git
synced 2026-07-24 12:51:55 +00:00
only track service provider calls if JAMBONES_TRACK_SP_CALLS is set
This commit is contained in:
+3
-3
@@ -324,9 +324,9 @@ module.exports = function(srf, logger) {
|
||||
}
|
||||
}
|
||||
}
|
||||
else 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,
|
||||
@@ -342,7 +342,7 @@ module.exports = function(srf, logger) {
|
||||
});
|
||||
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