Tariscope restriction feature for 3CX
Tariscope system provides the restriction feature for some telephone systems including 3CX. The restriction feature allows the Tariscope administrator to set a limit for the specific type of calls for a subscriber, group of subscribers, route, or gateway. The limit can be set in monetary or time terms. The specific type of calls is defined by a call category, which is assigned to area (country) codes. When a subscriber or a group of subscribers exhausts the set limit, Tariscope will prohibit the subscriber or group of subscribers to make calls until the end of the period. Tariscope will remove this restriction at the beginning of a new period.
The basic Tariscope license does not include the restriction feature. To use the restriction feature you should have the Tariscope license, which includes the feature. Below we will consider how to configure the restriction feature in Tariscope.
First, you must install and configure Tariscope in accordance with the Tariscope documentation (http://www.tariscope.com/en/88-support_en/tariscope-4-6-administrator-en/1456-tariscope-4-6-admin-en.html).
Create a category which will be associated with the restriction feature (http://www.tariscope.com/en/81-support_en/tariscope-web-administrator-en/1161-categories-en.html) as it shown in Figure 1.
Figure 1
In the Tariscope menu, select Provider and rates → desired provider → Outgoing → Destination codes. The Destination codes page is displayed. Select the country and city codes for which calls should be restricted and set them to the created category. The windows where you set a category for area codes is shown in Figure 2.
Figure 2
In the Tariscope menu, select Communication nodes → your node name → your 3CX → Restriction classes. The Restriction classes page is displayed.
Create a restriction group. The group can include several classes of restrictions. You must associate each of the classes with a specific category of calls on which the restriction is set. Often one class of restrictions is sufficient. Create a restriction class. To do this, select the restriction group and click on the Add class icon on the toolbar. The Restriction class window appears as it is shown in Figure 3.
Figure 3
In the Name text box, enter a name for the restriction class.
In the Class text box, you should enter information that can be used in a script for this restriction. Usually for 3CX this information does not play a role.
Click on the Save button.
To associate a class with a category, select the class and click on the Configure categories icon on the toolbar. The Categories window appears. An example on the window is shown in Figure 4.
Figure4
Turn on the category which you set for area and country codes and click on the Save button.
In the Tariscope menu, select the Subscribers item. The Subscribers active page is displayed. Depending on the license you have, you can set the limits to only subscribers or also groups of subscribers. If you have the Tariscope license with restriction feature of “Only for subscribers”, you set the limits only for subscribers. If you have the Tariscope license with restriction feature of “Only for subscribers or groups of subscribers” or “All”, you can set the limits both subscribers and groups of subscribers.
To set a limit for a subscriber, select the subscriber on the page and click on the Restrictions icon on the toolbar. The Edit page appears. Click on the Add icon on the toolbar to add a limit. The New restriction window appears as it is shown in Figure 5.
Figure 5
In the Categories list, select a category whish is used for restrictions.
In the Restriction type list, select the Money item if you set a money limit, or the Seconds item if you set a time limit.
In the Restriction class list, select the class which you created in the previous configuration step.
In the Credit box, enter a limit value.
Click Save.
Repeat these actions for other subscribers.
If you need to set a limit for group of subscribers, select the group and click on the Restrictions icon on the toolbar. Repeat the steps that were described above for the subscriber.
The last step in setting the restrictions is settings of Tariscope Observer. In the Tariscope menu, select Data Collection/Observer → Observers management. The Data Collection/Observer page appears. Select the row for 3CX and click on the Edit icon on the toolbar. The menu appears. Select the Observers’ scripts item. The page appears as it is shown in Figure 6.
Figure 6
If you want to restrict only subscribers, in the Event list, select the Change class of service item. In the Script list, select the setcos-subscriber-3cx-v18.cs item.
If you want to restrict a group of subscribers, in the Event list, select the Group state changed item. In the Script list, select the setcos-group-3cx-v18.cs item.
Then, click on the Edit button that is on the right of the Script list. The Edit window appears an example of which is shown in Figure 7.
Figure 7
You should change the values in the script specifying your values.
In the following line, specify a username which you use to login to 3CX with admin rights:
const string PBX_USERNAME = "username";
In the following line, specify a password which you use to login: const string PBX_PASSWORD = "admin_password";
In the following line, specify IP address and IP port of your 3CX:
const string PBX_HOST = "http://your_pbx_address:5000";
Click Save.
In the Unrestrict interval list, select the desired period. The default value is Every month.
In the Next auto unrestrict interval calendar box, select day and time when the set restrictions must be reset. For example, this could be the beginning of the first day of the next month if the interval is one month.
Click on the Save button.
Start the Tariscope Observer.