The quota system ---------------- The quota system works with OpenSIPS data sources. It enforces maximum monthly usage limits for post-paid accounts. The system is not stopping in real-time ongoing calls but provides in practice a protection against fraudulent usage on a platform basis. To enable quotas you must: 1. Add the the column quota to the opensips subscriber mysql table: alter table opensips.subscriber add column quota int unsigned not null; 2. Set the quota for each subscriber to a value, which represents the cost the subscriber is allowed to spend per calendar month. 3. Configure OpenSIPS to deny sessions initiated by subscribers belonging to the quota group: The quota system then builds incremental statistics, and stores them in cdrtool.quota_usage mysql table, with usage information from the normalized SIP sessions. It then compares the curent usage with the assigned monthly quota and blocks the subscribers when their quota is exceeded by adding them to the group 'quota'. The quota is checked by the cron job: /var/www/CDRTool/scripts/OpenSIPS/quotaCheck.php At the beginning of each calendar month the quota usage is reset and all users are unblocked: /var/www/CDRTool/scripts/OpenSIPS/quotaReset.php The current quota usage can be monitored in Rating -> Quota usage web page. When quota is exceeded, an email notification is sent to the user and a copy of the message to the platform administrator. To customize the email message subject, body and other header fields you must create some entries in cdrtool.settings table. See CDRTool/setup/mysql/custom_notifications.mysql for an example.