Skip to content

Commit 95930bc

Browse files
committed
reject calls on hosted jambonz with no activ
e subscriptions
1 parent 9feb6f3 commit 95930bc

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

lib/middleware.js

+5
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,11 @@ module.exports = (srf, logger, redisClient) => {
174174
});
175175
return req.srf.endSession(req);
176176
}
177+
if (!account_limit && !sp_limit && process.env.JAMBONES_HOSTING) {
178+
logger.info(`checkLimits: no active subscription found for account ${account_sid}, rejecting call`);
179+
res.send(503, 'No Active Subscription');
180+
return req.srf.endSession(req);
181+
}
177182
if (process.env.JAMBONES_TRACK_SP_CALLS && sp_limit > 0 && callsSP > sp_limit) {
178183
logger.info({callsSP, sp_limit}, 'checkLimits: service provider limits exceeded');
179184
writeAlerts({

package-lock.json

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"jslint": "eslint app.js lib --fix"
2828
},
2929
"dependencies": {
30-
"@jambonz/db-helpers": "^0.9.7",
30+
"@jambonz/db-helpers": "^0.9.9",
3131
"@jambonz/realtimedb-helpers": "^0.8.9",
3232
"@jambonz/http-health-check": "^0.0.1",
3333
"@jambonz/mw-registrar": "0.2.7",

0 commit comments

Comments
 (0)