Working with SBC 1000 and SBC 2000 gateways in Tariscope
The ability to collect and process CDR information from the SBC 1000 and SBC 2000 gateways from the Ribbon Communications company has been added to the Tariscope billing system.
These gateways transmit CDR data only to the Radius accounting server. Therefore, a new data source, the Radius accounting server, was added to the Tariscope Observer service. Data packets transmitted to the Radius accounting server are of two types: Start and Stop. Generalized information about the completed call is contained only in Stop packets, therefore only their processing is performed in Tariscope. Both Start and Stop packets are generated in the SBC for each call participant. Only one Stop packet is processed to avoid data duplication in the Tariscope system.
Next, we will present the Tariscope configuration features that are specifically related to the SBC 1000 and SBC 2000 gateways.
First of all, you need to create a suitable telephone system in Tariscope. To do this, select from the menu: Communication nodes → your node → Equipment → Equipment management. The Equipment page appears, an example of which is shown in Figure 1.
Figure 1
Click the Add icon on the toolbar. In the New equipment window that appears, enter any name. We recommend that you enter a name that matches the phone system, for example, SBC 1000. Click Save. The Edit page shown in Figure 2 will appear.
Figure 2
In the Equipment list, select the Ribbon SBC 1000, 2000 item. For these gateways, no further settings for CDR processing are required.
Just add the necessary parameters in the Codes and location section and click Save.
For the correct tariffication of calls, you must perform settings on the pages: Numbering plan and Routes and gateways, as well as add subscribers of this telephone system.
And finally, you need to create a Tariscope Observer service that will receive CDR data from SBC gateways and process this data.
Select Data collection/Observer → Observers management from the menu. The corresponding page will appear, where on the toolbar click Add → New Observer. A corresponding window will appear where you can enter the name of the Observer profile. For example, it could be: SBC 1000. Click Save. A window will appear confirming the creation of a new Observer profile, click on the Settings button. The Tariscope Observer configuration page will be displayed, an example of which is shown in Figure 3.
Figure 3
The Equipment item is "not selected", which means that you must specify the telephone system from the previously created ones for which this Observer is intended. Click on the "here" link and select the desired network and phone system.
In the Data source list, select Radius accounting server. Click on the Data source configuration button to the right of the Data Source list. The Data source configuration window will appear, an example of which is shown in Figure 4.
Figure 4
In the Port textbox, enter the IP port on which the Radius accounting server will work. By default, the port for this server is 1813. If you have multiple phone systems that need to transmit CDR data to Tariscope through the Radius accounting server, use port 1813 for the first Radius accounting server, and other IP ports for the other Radius servers, which free on your system.
In the Shared secret textbox, enter the value of the shared secret. The same value should be in the settings of the telephone system that will transmit CDR data.
Click Done.
This concludes the settings that are specific to the SBC 1000 and 2000 gateways. Perform all other settings in Tariscope according to the recommendations given in the Tariscope 4.6 document. Administrator's Guide.
Configuring Tariscope Observer
The Tariscope Observer service (or simply Observer), which is one of the Tariscope applications, is intended for automatic collection of information about completed calls (CDR, SMDR, AMA and others) from the PBX or from files located in some folder, initial processing of this data, and also for executing scripts for individual events.
That is, the Observer is the link that connects the telephone system with the Tariscope system. One Observer is designed to interact with one telephone system (PBX). Tariscope has no limit on the number of Observers it can receive information from. Observer can be configured to receive CDR information from various types of data sources, which are mentioned below. The choice of data source type primarily depends on the type of telephone system from which the CDR data is received.
Observers can be located both on the same server where the Tariscope system is located, and on a remote computer (server) that has a connection with the Tariscope server via an IP network. Any Observer, local or remote, must have IP communication with the Tariscope server (the TS.MAIN service) and the Microsoft SQL Server (hereinafter “SQL Server”) on which the Tariscope database is installed. When the Observer starts, it contacts the Tariscope server, receives a database connection string from it, and then connects to the Tariscope database. If you have a firewall or other security systems, you must configure them that Observer will have IP access to Tariscope server (IP port: 8001) and SQL server (IP port: 1433, 1434).
An Observer can react to the following events by executing a specific script:
- Data source connected.
- Data source disconnected.
- Change class of service. This event is only relevant if the Tariscope license includes the restriction feature for subscribers.
- Group state change. This event is only relevant if the Tariscope license includes the restriction feature for group of subscribers.
- Periodic action.
- New call. The script for this event allows you to perform some additional data processing on information about the received call. For example, you can check whether the dialed number does not belong to a specific group of phone numbers.
- Database unavailable. This event may be relevant if Observer and Microsoft SQL Server are on different servers. If you lose connection to the database, a script can send a message to the administrator.
Regardless of whether you are configuring local or remote Observers, you need to configure them in the Tariscope application. These settings are the same for both types of Observers. In the future, we will consider the features of remote Observer customization
In the Tariscope menu, choose: Data collection/Observer → Observer management. A page appears, an example of which is shown in Figure 1.
Figure 1
Let's create a new Observer. Click the Add icon on the toolbar. A menu appears, select the New Observer item. The window shown in Figure 2 will appear.
Figure 2
In the Name box, enter the name of the Observer profile. We recommend naming the profile with the name of the telephone system from which this Observer will receive data. For example, you need to receive data from CUCM (Cisco). In this case, it is better to name the profile: CUCM. The name must not contain any characters other than letters and numbers. Click Save. A window will be displayed to confirm the creation of the profile (Figure 3).
Figure 3
Click Settings. The Tariscope Observer configuration page appears, an example of which is shown in Figure 4.
Figure 4
Click on the 'here' link and select an existing phone system. For our example, it should be CUCM.
In the Data source list, select the appropriate source. For our example, if CUCM is configured as an FTP client, the data source should be an FTP server. For other types of telephone systems, data sources can be: FTP client, TCP client or server, local or remote folder, and others, depending on how the telephone system provides CDR data. To configure the data source parameters, click on the button to the right of the Data source list and perform the settings. See the documentation for a description of setting up a specific data source.
The Storage of processed CDRs box is intended to select a folder to store the raw CDR data that is received from the telephone system. This data can be used if it is necessary to completely reprocess call data. By default, they are stored in the C:\ProgramData\Tariscope folder. CDR logs have the extension CDR, and the file name includes the name of the Observer's profile and the date.
In the Creation period list, select the period for creating logs with primary CDR data. The period of creation depends on the call traffic. If it is higher, the better to choose a shorter period. One month is offered as a default period.
In the Log level list, select the level of detail for the Observer profile log. The least detailed level is Status, the most detailed level is Debug.
This concludes the debugging of the local Observer. If you are configuring a Remote Observer, enable the Remote observers switch.
Click the Save button. The Data Collection/Observer page will look similar to the one shown in Figure 5.
Figure 5
If you have created a local Observer, you can start it by clicking on the Control icon and selecting Start.
In the case when you configured a profile for a remote Observer, perform the following actions.
Work on a remote server
Before making settings on a remote server, you should:
- Perform the settings indicated above on the Tariscope server.
- If a firewall is running on the Tariscope server, add rules that will allow access to the IP ports: 8001 (Tariscope server is running on it), 1433, 1434 (SQL server ports).
- Verify that the server where Tariscope was installed is reachable over the network from the remote server where Remote Observer is installed.
Install Tariscope on the remote server (computer). http://www.tariscope.com/en/88-support_en/tariscope-4-6-administrator-en/1458-installation-4-6-en.html#:~:text=1.1%20Installation%20for%20Windows
When performing the installation for Windows, in the Tariscope components stage (Figure 1.1.5 in the article at the link above), select the Observer Server. By default, the installation is performed in the folder: C:\Program Files (x86)\SoftPI\Tariscope
To run a remote Observer, you must know:
- IP address of the server where the Tariscope server is installed. For example, the IP address of the Tariscope server is 10.10.0.148.
- The name of the profile that was created there specifically for this Observer. In our example, it is: CUCM.
Open Command Prompt with Windows administrator rights. Run the following commands there.
Go to the software folders. If you installed to the default folder, this will be the command:
cd C:\Program files (x86)\SoftPI\Tariscope\Microservices
Next, start the remote Observer, specify the name of the profile (the name parameter) and the URL of the Tariscope server (the main parameter) as its parameters. An example of such a command is given below:
.\Tariscope.Observer.exe /name=CUCM /main=”http://10.10.0.148:8001”
In this example, the name of the profile is CUCM and the URL of the Tariscope server is http://10.10.0.148:8001 , where 10.10.0.148 is the IP address of the server and 8001 is the IP port on which the server is running.
An example of such data entry is shown in Figure 6.
Figure 6
If all the settings are made correctly and the network provides access from the remote Observer to the Tariscope server, then the Observer will be connected to Tariscope and SQL Server.
You can check the result of connecting Observer in its log. Observer logs, both local and remote, are kept in the C:\ProgramData\Tariscope\Logs\Observer folder on the Tariscope server or on the remote server, respectively. The log is named [Profile Name].log. For our example, this will be the file: CUCM.log
This log is generated only after the remote Observer has successfully connected to the Tariscope server. If there is no log, it means that the connection failed.
An example of the log is shown in Figure 7.
Figure 7
You can also check the connection of the remote Observer to Tariscope in Tariscope on the Observers page (Figure 8).
Figure 8
As you can see in the figure, the Service status column displays the value Online.
You must leave the Command Prompt window open with the Remote Observer running. Closing the Command Prompt will terminate Observer. And to restart it, you will need to load the Command Prompt again and repeat the above commands.
To create other remote Observers, you need to repeat all the above actions: create a profile in Tariscope, launch a remote Observer with the appropriate profile name.
You can run remote Tariscope Observers as Windows services. For this, you can use, for example, the third-party program: nssm (https://nssm.cc/).
To create a remote Observer service, run the nssm program with the following command:
nssm install TS.Observer,
where TS.Observer is the name of the service being created. If you create multiple services, they must have different names. As a result of executing the command, the window appears as shown in Figure 9.
Figure 9
In the Path box, enter the path to the Observer file:
C:\Program files (x86)\SoftPI\Tariscope\Microservices\Tariscope.Observer.exe
In the Arguments box, enter the Observer parameters: the name of the profile and the URL of the Tariscope server. For our example it will be:
/name=CUCM /main=http://10.10.0.148:8001
Click Install service.
A corresponding Windows service will be created, which must be started from the Windows Services window.
Import of codes and rates in Tariscope
If you are a user of Tariscope Enterprise or Tariscope Provider and you are interested in the cost of calls that were made by your telephone systems subscribers (customers), then you must add rate (tariff) data into the Tariscope database.
If your PBX is connected to Public Switched Data Network (PSDN) through one telecommunications service provider (TSP), then all calls will be rated at the rates of this TSP. If the PBX has a connection with different TSP, then a call for the same destinations will depend on which the TSP was made through. Therefore, Tariscope rates are tied to a specific TSP.
For Tariscope Provider users, which are a TSP themselves, it should also be borne in mind that you may have different rate plans that are assigned to customers, so customers with different rate plans may have different call costs with the same duration. To fulfill this, the cost of a specific rate should be attached to the rate plan.
In order for Tariscope to know what the rate will use to calculate the cost of a specific call, it detects a telephone code in the dialed number and finds the rate that corresponding to this code. Therefore, the rate should be tied to a specific phone code. Of course, one rate can be tied to many phone codes.
Tariscope contains data on several TSPs. Therefore, you can choose any of these TSPs or create a new TSP based on the existing one and then to change a list of rates, their cost and tie to specific telephone codes.
In addition, you can also create a new TSP, create a list of rates and tie these rates to phone codes.
Finally, rates and telephone codes can be imported from external files. It is this option that we will look at this article.
So, to import rates and codes into the Tariscope system you must have a file of one of the following formats:
- Microsoft Excel 2007 (.xlsx).
- Microsoft Excel 2003 (.xls).
- Microsoft Access (.mdb).
- Microsoft Access 2007 (.accdb).
- Comma separated (.csv).
Excel format files are usually used. Therefore, we will consider importing from this file format. But the import for other formats is no different.
Let's list the minimum necessary fields for importing telephone codes and rates:
- Name for phone code and rate.. This is usually the name of a country or city, or a mobile operator.
- Phone code or codes.. If several codes are specified, they must be separated by commas.
- Rate cost.
- Date.. The date from which the rate is valid. If the date is missing, the current date which was set on the computer will be substituted during import.
Additionally, other fields can be specified, which we will mention later.
An example of an Excel file for importing codes and rates is shown in Figure 1.
Figure 1
In it, column A contains the name for the code and rate, column B contains the rate value in dollars, column C contains telephone codes, column D contains the date from which the rate is effective, and column E contains a code correcponds to the call type in Tariscope. There are the following codes in Tariscope:
3- in city;
4 - long distance;
5 - international;
6 - mobile.
Before starting the import, you must have a rate plan to which rates will be imported.
Let's create a new telecommunication service provider and import data from an Excel file into it.
To create a new TSP, select Providers and rates → Provider management in the menu. The Providers page will appear, an example of which is shown in Figure 2.
Figure 2
Click the Add icon on the toolbar. The New provider window appears, where in the Name box, enter the name of TSP. We will create the TSP that is a name of Test 001. If you need to add comments to this name, enter it in the Description position. Click Save. A new row appears on the Providers page.
After that, go to the Common phone codes page, an example of which is shown in Figure 3.
Figure 3
Click the Import Wizard icon on the toolbar. The Import Wizard page appears, an example of which is shown in Figure 4.
Figure 4
Click on the Start button. As a result, the page will take the form shown in Figure 5.
Figure 5
In the File Type list, select your file type with codes and rates. Click the Choose button and select this file. Then click Next.
If you have chosen an Excel file, the next step (Figure 6) will allow you to select the worksheet that contains the necessary data in this file in the Available Tables list.
Figure 6
Click Next and the Import Wizard page appears as shown in Figure 7.
Figure 7
In this import step, the user must associate the Tariscope database fields with the column names of the file being imported from. To quickly identify the columns of the file, they are displayed at the bottom of the page.
In the Code list, select the column that contains the telephone code or codes. In the given example, this is the column named Numbering plan.
The Name list is used for the name of the settlement or mobile operator to which the telephone codes belong. In the given example, this is the column named Destination.
In the Rate name list, in most cases, you should choose the same value as in the previous one. For our example, this is the column named Destination.
In the Rate list, select the column that contains the price of the rate. For our example, this is a column with the new Rates in USD per minute.
If the import file has a column that contains information about the type of call: international, long distance, mobile, and other, then select that column in the Call Type list. This is an optional parameter.
Any telephone code can be linked to a pre-created call category. The presence of a category can allow you to filter calls by them, create special reports, and also set restrictions for subscribers, if the Tariscope license includes a restriction function. To set a category for a phone code, select it in the Category list. This is an optional parameter. The example file does not have a corresponding column.
In the From date list, select the column with the date from which the telephone code becomes effective. In the given example, this is the Effective Date column. If there is no such column in the import file, the current date will be set as the effective date of the phone code during import.
If the import file contains a column with the date until which the telephone code is valid, then select this column in the To date list. This is an optional parameter.
Tariscope can charge for both outgoing and incoming calls. Separate rates are used for each of them. Accordingly, you must choose for which type of calls the tariffs will be imported: for outgoing (in the import file the value must be 0) or incoming (in the import file must be the value 1). If there is no such field in the file, then do not select anything in the Rate direction item. In this case, outgoing calls will be understood.
In the From date (rate) list, select the column with the date from which the rate starts. In the given example, this is the Effective Date column. If there is no such column in the import file, the current date will be set as the effective date of the rate during import.
Thus, for our example, the selection should be made as shown in Figure 8.
Figure 8
Click Next. The wizard page will take the form shown in Figure 9.
Figure 9
These are the final import settings.
If you need to import both telephone codes and rates, the Import only codes switch should be disabled.
In the Provider list, you should select the operator to which rates will be imported. We created the test5 provider, which we selected.
In the Default rate plan list, select the one to which the rate costs will apply.
In the Currency item, select the one in which the rates are specified in the import file. In our file, it is USD.
If you are a TSP and you use Tariscope Provider, and you want calls for all tariffs that will be created to be charged to the subscriber's personal account per month under one name, for example, "International calls", then enter this name in the Description for accounts textbox.
If it is necessary that the tariffing should be carried out with an accuracy of seconds, then the Rounding to minutes switch should be turned off.
The Update rates switch is relevant when you update data on previously entered rates. In this case, you should enable this switch. If it is disabled, then only new telephone codes and their rates, which are in the import file, will be added.
Click Import.
After the import is finished, information about the number of added telephone codes and rates appears.
If you update rates for telephone codes already existing in the database, these codes will not be added again.
If you return to the tariff page of the specific provider for which the data was imported, and select the appropriate rate plan there, you will see all the imported rates (Figure 10).
Figure 10
Only importing codes and rates into the Tariscope system is not enough for the correct charging of calls. There are still some settings that need to be done. There is a separate article about these settings. Let's note only what is related to the codes and the rates of a specific operator. This provider must be tied to routes (groups of communication lines), gateways of the telephone system.
In the case when you have just created a new provider and you did something wrong when importing the codes and rates, you can simply delete this provider and then create it again. To do this, use the Providers page (Figure 2).
If you are a telecommunications service provider and you have several rate plans in which the cost of rates is different, which is a certain percentage of the cost of the main rate plan, then you can easily create additional columns for these rate plans in your Excel file. And then you should repeat the rate import for these rate plans.
There is one more feature for users of the Tariscope Provider edition to be aware of. When importing rates, a separate rate is created for each telephone code or group of telephone codes that are specified in one line. When processing information about calls in the table of personal accounts of subscribers, a separate record will be created for the reporting period for each rate, and all calls for this rate will be summarized in one record. For example, if the subscriber made calls to 20 countries during the month, then 20 entries will be created in the personal account of this subscriber. In most cases, it is not necessary, but one record, for example, with the International calls name, which would combine the charges for all international calls, is enough. There is a setting in rates that allows you to combine all charges for calls of a certain type with different rates in one personal account record. For this, the Description box on the Accounts tab of a specific rate is used (Figure 11). That is, if in all rates related to calls to other countries, enter, for example, the name of International calls in this box, then all charges for calls abroad during the month will be charged to one record.
Figure 11
You can add such a description at the same time for a group of rates if you enable the Show all entered dates and Multiselect switches on the Rates page (Figure 12).
Figure 12
The necessary lines are selected by clicking on the required lines of the rate table.
But with a large number of rates, their selection can take a long time. Therefore, we suggest using SQL query execution. Let's say we want to set the International calls name to personal accounts for all rates starting January 1, 2022.
To do this, select Additional options → SQL queries in the menu, where you should enter the following query:
UPDATE TarifSettings SET AccountsDescription = 'International calls' WHERE RecDate = '20220101'
In this query, change the date 01/01/2022 ('20220101') to the date you want and the value of 'International calls' to the name you want.
Click the Run icon on the toolbar. After that, all calls that will be processed according to these rates will be charged to one record with the name ‘International calls’.
Here are a few more SQL queries that may come in handy.
Change of rate date.
For example, it is necessary to change the effective date of all rates to 01.02.2022, which currently have a date of 01.01.2022. To do this, the following query should be executed on the SQL query page:
UPDATE TarifSettings SET RecDate = '20220201' WHERE RecDate = '20220101'
Deleting rates for a specific date .
For example, you need to delete all tariffs effective from 01.02.2022. To do this, you should execute the following query:
DELETE FROM TarifSettings WHERE RecDate = '20220201'
Related articles
1. Telecommunications service providers.
2. Configuration of call rating in Tariscope.
3. Rate plans.
Working with new Tariscope API methods
Any self-written application or third-party application that is designed for this purpose can be used to test the Tariscope API functionality. The Postman application was used for testing in this article.
To work with the Tariscope API, first, you need to create a suitable user and grant him rights to all or individual API methods.
To create a API user, in the Tariscope menu, select Advanced options → Integrations. Click on the Tariscope API button. The corresponding page will appear.
Click on API users. Click on the Add icon on the toolbar.
The New API user window appears, where you need to enter the required parameters and click on the Save button.
In the list of API users, select the one you created and click on the Method rights icon. The Claims setup for user page will appear, an example of which is shown in Figure 1.
Figure 1
The figure highlights the methods that were added in Tariscope version 4.6.4. These methods have the following purpose:
- accounts.charges. This is a GET method that allows you to get all charges of a specific subscriber for the specified period.
- accounts.payment. This is a POST method that allows you to enter information about payments from the subscriber for the provided communication services into the Tariscope database.
- accounts.payments. This is a GET method that allows you to get information from the Tariscope database about payments from a specific subscriber for a given period.
- subscriber.create. This is a POST method that allows you to create a new subscriber without a list of phone numbers (DNs) that belong to him. The following method should be used to add phone numbers (DNs).
- subscriber.dnadd. This is the POST method that allows to add a phone number (DN) for the subscriber.
Work with the Tariscope API must begin with the authorization of the API user in the system, which is performed using the api.auth method. As a result of the execution of this method, you should receive a token that must be used when executing all other API methods. The token is valid for 6 hours. After that you should get a new token.
1. Receiving the token
To perform any API method, you should authorize in the system. Execute the /api/auth method.
As mentioned above, working with the Tariscope API methods will be demonstrated using the Postman program.
Select the Post method and enter a request to connect to the computer where Tariscope is installed (Figure 2).
Figure 2
An example of the request:
http://localhost:7000/api/auth
localhost is used only if the application from which the API request is executed is on the same server as the Tariscope software. Otherwise, use the IP address of the Tariscope server.
7000 is the IP port on which Tariscope is running. By default, when installing Tariscope, IP port of 8085 is used.
/api/auth is a method for authorization in the system.
Before sending a request, you should select the row value in the Body tab of the request, set the JSON format and enter the username and password in this format.
On the Authorization tab, select Bearer token.
After that, click on the Send button. If all parameters are set correctly, you will receive a response in JSON format, from where you should copy the token.
To execute all other Tariscope API methods, this token should be inserted on the Authorization tab in the Token textbox. We remind you once again that the token is valid for 6 hours.
2. Receiving subscriber's charges
Receipt of charges is performed using the GET method /api/accounts/charges
Method parameters:
- id – subscriber ID in the Tariscope system.
- fromdate – the date from which the charge should be received. The date is set in the format: yyyy-MM-dd, for example: 2023-05-01.
- todate – the date by which the charge must be received. The date is set in the format: yyyy-MM-dd, for example: 2023-05-31.
For example, we are interested in the billing of a subscriber with ID 6169 for May 2023. That is, in this case we have:
id = 6169, fromdate = 2023-05-01, todate = 2023-05-31. Accordingly, we set the GET request:
http://localhost:8085/api/accounts/charges/?id=6169&fromdate=2023-05-01&todate=2023-05-31
An example of such a request in the Postman program is shown in Figure 3. It should not be forgotten that, as in the previous request, the user's API name and password should be specified in its body.
If all parameters are specified correctly, Tariscope will return information about the subscriber's billing.
Figure 3
List of parameters for each calculation:
- id – subscriber ID in the Tariscope system.
- recdate – date of entry of charge in Tariscope.
- fromdate – the start date of the service billing period.
- todate – the date of the end of the service billing period.
- servicename – service name.
- charge – charged amount.
- numberofservices – the number of charged services. For calls, this is the number of seconds.
An example of the server's response is shown in Figure 4.
Figure 4
If the query is specified incorrectly, or the query parameters are incorrectly specified, Tariscope returns a message about this. An example of this is shown in Figure 5.
Figure 5
3. Entering payment information in Tariscope
Entering payment information from the subscriber is performed by a POST request: /api/accounts/payment
Parameters of the POST request to the Tariscope system:
- id – subscriber ID in the Tariscope system.
- paymentday – payment execution date in the format: yyyy-MM-dd.
- payment – amount of payment for communication services.
- paymenttype – type of payment (not specified – 0, cash – 1, by receipt – 2, by account – 3).
- bank – the bank through which the payment was made.
Example.
The subscriber with the identifier of 6193 paid for communication services in the amount of USD 370.00 on 05/17/2023 on account through XXXBank. This means: id=6193, paymentday=2023-05-17, payment=370.00, paymenttype=3, bank=XXXBank
The POST request will be as follows:
http://localhost:8085/api/accounts/payment/?id=6193&paymentday=2023-05-17&payment=370.00&paymenttype=3&bank=XXXBank
If the query parameters are correct, Tariscope will return the following data:
- subscriberid – subscriber ID in the Tariscope system.
- paymentid – payment record identifier.
- paymentday – date of payment in the format: yyyy-MM-dd.
An example of the answer is shown in Figure 6.
Figure 6
4. Receiving information on subscriber payments for the period
Obtaining such information is performed with a GET request: /api/accounts/payments
This request has the following parameters:
- id – subscriber ID in the Tariscope system.
- fromdate – the date from which payments are to be received. The date is set in the format: yyyy-MM-dd, for example: 2023-05-01.
- todate – the date by which payments are to be received. The date is set in the format: yyyy-MM-dd, for example: 2023-05-31.
- paymentid – payment record identifier. If this identifier is specified in the request, then the dates are ignored, and the presence of such a record in the Tariscope database is checked. If this identifier = 0, then the ARI must return all payments for the specified period.
Example.
Get information about payments from the subscriber with the identifier 6169 for the period from 04/01/2023 to 05/31/2023. This means that the following parameters must be set: id=6169, fromdate=2023-04-01, todate=2023-05-31, paymenеtid=0
That is, the entire GET request will be as follows:
http://localhost:8085/api/accounts/payments/?id=6169&fromdate=2023-04-01&todate=2023-05-31&paymenеtid=0
If all parameters are specified correctly, Tariscope will return the following data:
- subscriberid – subscriber ID in the Tariscope system.
- paymentid – payment record identifier.
- paymentday – date of payment in the format: yyyy-MM-dd.
- payment – payment amount.
An example of the result of executing such a request is shown in Figure 7.
Figure 7
5. Creating a new subscriber
Creating a new subscriber is done using a POST request: /api/subscriber/create
This request has the following parameters:
- fullname – full name of a legal entity, individual, or employee of a communications operator.
- departmentid – ID of the group to which the subscriber belongs. If the subscribers are not divided into groups, then they belong to the root group, which has the same name as the communication node.
- subscribertype – subscriber type: 0 - individual, 1 - legal entity, 2 - official, 3 - budget, 4 - preferential.
- connectiondate - date from which the subscriber is considered connected in the format: yyyy-MM-dd.
- contactnumber – contract number with the subscriber.
- contractdate - contract date in the format: yyyy-MM-dd.
- accountnumber - subscriber's personal account number, if it is not created automatically in Tariscope.
- personalcode – individual tax number for individuals.
- edrpou – legal entity code.
- taxcode – tax code for legal entity.
- bankcode – bank code for legal entities.
- bankname - name of bank.
- bankaccount – bank account number.
- rateplanid – identifier of the rate plan assigned to the subscriber.
Example.
Create a subscriber, a legal entity with the name of JSC ABC, its code is 55667788, a tax code is 123456789, with a date of connection from 02.06.2023, with which a contract for the provision of communication services under the number 247-23 dated 01.06.2023 was concluded. This company is served by XXXBank, the bank code is 325365, the bank account is UA125438790123456. This subscriber will be served with the “Basic” rate plan, which has the identifier 43 in Tariscope. The subscriber belongs to the group of subscribers with the identifier of 419. The personal account of8640-fo should be assigned to the subscriber
For these parameters, the following POST request must be performed:
http://localhost:8085/api/subscriber/create/?fullname=JSC ABC&departmentid=419&subscribertype=1&connectiondate=2023-06-02&contractnumber=247-23&contractdate=2023-06-01&accountnumber=8640-fo&personalcode=&edrpou=55667788&taxcode=&bankcode=361234&bankname=XXXBank&bankaccount=UA125438790123456&rateplanid=43
With the correct settings, Tariscope returns the following information:
- id – subscriber ID in the system.
- accountnumber - subscriber's personal account number. If it is generated automatically in Tariscope, it will match the id.
- fullname – full name of a legal entity, an individual, or an employee of the telecommunications provider.
An example of information received from Tariscope for this request is shown in Figure 8.
Figure 8
6. Adding a phone number to the subscriber
To add a phone number to a subscriber, you need to perform a POST request: /api/subscriber/dnadd
This request has the following parameters:
- SubscriberId. Subscriber ID to which the phone number is assigned.
- DN. The phone number assigned to the subscriber.
- description. Description to the phone number. Optional parameter.
- fromdate. The date from which this number belongs to the subscriber.
- pbxid. The identifier of the PBX to which the telephone number belongs.
Example.
The subscriber with the identifier 7334 must be assigned the telephone number 2001 from 02.06.2023. The number belongs to the PBX with identifier 292.
The following POST request should be created for these parameters:
http://localhost:8085/api/subscriber/dnadd/?SubscriberId=7334&DN=2001&description=&fromdate=2023-06-02&pbxid=292
If the request parameters are specified correctly, Tariscope will return the following information:
- id. Phone number identifier in Tariscope.
- subscriberid. Subscriber ID to which the phone number is assigned.
- pbxid. The identifier of the PBX to which the telephone number belongs.
- dn. Phone number.
An example of obtaining information about adding a number is shown in Figure 9.
Figure 9
Tariscope installation on Linux
The Tariscope 4.6.x system of both Enterprise and Provider editions is created on the basis of the .Net 5.0 software platform and Microsoft SQL Server. Therefore, the choice of Linux distributions for Tariscope depends on support for these two components.
Tariscope supports work with any edition of Microsoft SQL Server 2022 or 2019 or 2017. According to Microsoft's documentation, SQL Server 2022 or 2019 can be installed on:
- Red Hat 7.7 - 7.9 for SQL Server 2019 or 8.0 - 8.6 for SQL Server 2022 and 2019.
- SUSE 12 (SP3 - SP5) for SQL Server 2019 or 15 (SP1 -SP3) for SQL Server 2022 and 2019.
- Ubuntu 16.04, 18.04 for SQL Server 2019 or 20.04 for SQL Server 2022 and 2019.
The system requirements for a Linux installation are the same for both versions of MS SQL Server:
- RAM: 2 ГБ;
- File system: XFS or EXT4;
- Disk space: 6 ГБ;
- Processor frequency: 2 ГГц;
- Processor type: compatible with x64.
Tariscope requires .Net 5.0 to work, so if Tariscope is installed only by itself without Microsoft SQL Server, and Microsoft SQL Server will be installed somewhere on another server, then the .Net 5.0 platform can be installed on the following Linux distributions:
- Alpine,
- CentOS,
- Debian,
- Fedora,
- openSUSE,
- SLES,
- Snap-packets,
- Ubuntu.
If Tariscope is installed on the physical (virtual) server together with Microsoft SQL server, then Ubuntu and SUSE are suitable Linux distributions.
We tested Tariscope on Ubuntu 20.04.
The order of installation of Microsoft SQL Server, the .Net 5.0 platform and the required software applications required can be arbitrary.
1. Microsoft SQL Server 2022 installation
Installation of this SQL server should be done according to the instructions given in the article.
2. .Net 5.0 installation
Installation must be done with rights of root. Therefore, you should specify 'sudo' before each command, or to avoid specifying it every time, you can execute the command:
sudo -i
.Net 5.0 can be installed in one of the options:
- .Net Runtime.
- .Net SDK, it includes .Net Runtime.
To check which .Net Frameworks are already installed on the system, enter:
dotnet --list-runtimes
dotnet --list-sdks
There are different options for installing .Net 5.0. For instructions on how to install the .Net Runtime, see the Microsoft article.
Microsoft instructions for installing the .Net SDK or .Net Runtime using Snap.
For example, according to these recommendations, to install the .Net SDK version 5.0, you would run the following command:
sudo snap install dotnet-sdk --classic --channel=5.0
Next, it is recommended to register an alias for dotnet-sdk.dotnet in the system:
sudo snap alias dotnet-sdk.dotnet dotnet
If you installed .Net 5.0 using Snap, you should make a symlink:
ln -s /snap/bin/dotnet /usr/bin/dotnet
3. Installing additional applications
For Tariscope to work, you need to install the following applications:
- cpuid,
- inxi,
- libgdiplus,
- wkhtmltopdf.
To install them, execute the following commands:
apt-get install cpuid
apt-get install inxi
apt-get install libgdiplus
apt-get install wkhtmltopdf
4. Installing and running Tariscope
Download the Tariscope installation and two scripts:
http://softpiua.com/files/ts-install.sh
Unpack the tariscope46.tar.gz archive, for example, into the Tariscope folder, having previously created it.
Move the ts-install.sh script to this folder.
Let's say you are a user named softpi. You need to go to the Tariscope folder using the command:
cd /home/softpi/Tariscope
and execute the following command:
sh ts-install.sh -p /home/softpi/Tariscope
The '-p' switch specifies the folder where Tariscope is installed.
Connecting the Tariscope database to the Microsoft SQL server
Microsoft SQL Server is required to run the Tariscope database. Therefore, it should be installed there. If the Tariscope installation package was installed in the Tariscope folder, the backup copy of the Tariscope database will be in the folder
…/Tariscope/www/Database/Database
The Tariscope backup file has the name: Tariscope_clear.bak
In order to install the Tariscope database from a backup on an MS SQL Server, you need to either connect to this SQL Server from a Windows computer with SQL Server Management Studio (SSMS) installed on it, or install command line tools on Linux for working with MS SQL Server.
How to install command line tools for working with MS SQL Server can be found in the Microsoft article.
Next, connect to the SQL server by executing the command:
sqlcmd -s localhost -U SA -P Tariscope123
This command means that a connection is made to the local SQL Server (localhost). The connection is performed on behalf of the system administrator (sa). Password to the SQL server is Tariscope123. You must specify the password that was specified during the installation of Microsoft SQL Server.
When connecting to the SQL server, a symbol will appear in the terminal: '>', which means that you can enter SQL commands. To execute an SQL command, you must enter the GO command. To check the operation, you can issue a command to get the names of the databases that are on the SQL server:
1>select name from sysdatabases
2>go
And you should get the answer:
master
tempdb
model
msdb
After that, type quit to exit SQL Server management mode.
How to install a database from a backup copy can be read, for example, in the article.
That is, with root rights, you should go to the /var/opt/mssql folder by executing the command:
cd /var/opt/mssql/
Next, create a new backup folder:
mkdir backup
Move the backup file to the created folder:
mv /home/softpi/Tariscope/www/Database/Database/Tariscope_clear.bak /var/opt/mssql/backup
In your case, instead of the /softpi/Tariscope/ folder, there may be others, depending on the ones you created in the previous steps.
Connect to SQL Server again using the above command.
To restore the Tariscope database from a backup, execute the command:
RESTORE DATABASE Tariscope FROM DISK=’/var/opt/mssql/backup/Tariscope_clear.bak’
WITH MOVE ‘Tariscope’ TO ‘/var/opt/mssql/data/Tariscope.mdf’
MOVE “Tariscope_log’ TO ‘/var/opt/mssql/data/Tariscope_log.ldf’
GO
Installation of the Tariscope database will be performed. You can make sure that it is installed, for example, by executing the command that was already given above:
select name from sysdatabases
The Tariscope database should be added to the database list.
Exit SQL Server management mode.
Move the rrun.sh script to the www folder, which is in the Tariscope folder. Navigate to this folder:
cd /home/softpi/Tariscope/www
Locate the appsettings.json file. Open it for editing. An example of this file is shown in the figure below.
Figure
In the connection string (DefaultConnection) after Data Source, specify the IP address of the server where Microsoft SQL Server was installed. In the example in Figure 1.2.1, this is the IP address: 10.10.0.133. In the same line, the system administrator, "sa", with the password "Tariscope123" is specified as the user from whom the Tariscope system works. Instead of the "sa" user, you can use any other user who has all the rights (owner) to the Tariscope database.
Tariscope works on the Kestrel server. By default, this server keeps a log of requests to it. This is reflected in the line:
“KestrelLogger”: true
Change true to false to disable this logging. We recommend keeping this log.
The line "KestrelLoggerPeriod": 1 defines the period for creating a new Kestrel log: 0 - daily, 1 - weekly, 2 - monthly. Change the period for creating the log if necessary.
The IP port on which Tariscope will work is specified in the line:
"Http": "8085"
That is, IP port of 8085 will be used by default. Change it if necessary.
If you want Tariscope to work over HTTPS, you must have an SSL certificate and set its parameters in this file.
In the line "SSLCertificate": "" specify the path where the file of this certificate is located.
In the line "SSLPassword": "" enter the password for this certificate.
Specify the IP port for working over HTTPS in the line: "Https": ""
To enable HTTPS, change false to true in the line:
"HttpsEnabled": false
If you want to redirect all requests made in Tariscope via HTTP to HTTPS port, change the value false to true in the line:
"HttpsRedirect": false
Save the settings for this file.
Run Tariscope:
sh rrun.sh
You can check whether the Tariscope system is running using the command:
systemctl status TS.MAIN.service
If the system is up and running, you will receive a response like the following:
TS.MAIN.service - Tariscope daemon
Loaded: loaded (/etc/systemd/system/TS.MAIN.service; disabled; vendor pres>
Active: active (running) since Sat 2022-12-24 23:14:32 EET; 3min 8s ago
Main PID: 35886 (dotnet)
Tasks: 0 (limit: 4648)
Memory: 732.0K
CGroup: /system.slice/TS.MAIN.service
‣ 35886 /snap/dotnet-sdk/167/dotnet /home/softpi/Tariscope/www/Sof>
After that, in the browser, you can connect to the Tariscope system and start configuring it according to the document "Tariscope 4.6. Administrator's Guide".
Subcategories
How to configure
This category contains articles that were not included in Administrator's Guide and that describes how to configure a specific Tariscope feature