root/doc/QuotaSystem.txt

Revision 1127, 1.6 KB (checked in by Adrian Georgescu <ag@ag-projects.com>, 21 months ago)

Updated documentation
Show error whe accounts db class is not defined

Line 
1
2The quota system
3----------------
4
5The quota system works with OpenSIPS data sources. It enforces maximum
6monthly usage limits for post-paid accounts. The system is not stopping in
7real-time ongoing calls but provides in practice a protection against
8fraudulent usage on a platform basis.
9
10To enable quotas you must:
11
121. Add the the column quota to the opensips subscriber mysql table:
13
14alter table opensips.subscriber add column quota int unsigned not null;
15
162. Set the quota for each subscriber to a value, which represents the cost
17the subscriber is allowed to spend per calendar month.
18
193. Configure OpenSIPS to deny sessions initiated by subscribers belonging to
20the quota group:
21
22The quota system then builds incremental statistics, and stores them in
23cdrtool.quota_usage mysql table, with usage information from the normalized
24SIP sessions. It then compares the curent usage with the assigned monthly
25quota and blocks the subscribers when their quota is exceeded by adding them
26to the group 'quota'.
27
28The quota is checked by the cron job:
29
30/var/www/CDRTool/scripts/OpenSIPS/quotaCheck.php
31
32At the beginning of each calendar month the quota usage is reset and all
33users are unblocked:
34
35/var/www/CDRTool/scripts/OpenSIPS/quotaReset.php
36
37The current quota usage can be monitored in Rating -> Quota usage web page.
38
39When quota is exceeded, an email notification is sent to the user and a copy
40of the message to the platform administrator. To customize the email message
41subject, body and other header fields you must create some entries in
42cdrtool.settings table. See CDRTool/setup/mysql/custom_notifications.mysql
43for an example.
44
Note: See TracBrowser for help on using the browser.