Interaction of Tariscope with 3CX v20
This article is intended for users of Tariscope Enterprise or Tariscope Provider licenses, with the restriction function used to manage 3CX v20 PBX IP addresses.
Starting with Tariscope 4.6.7, a new script has been developed for the Tariscope Observer application, which transmits commands to restrict subscribers or remove these restrictions to a separate TSconnector application. This application is installed on the server with 3CX v20, and it directly sends commands to this PBX. There are separate applications for Windows and Linux, depending on which operating system 3CX runs on. For the restriction feature to work in Tariscope, it does not matter which system Tariscope is running on, whether Windows or Linux.
The diagram of the interaction of the Tariscope billing system (call accounting system) with 3CX is shown in Figure 1.

Figure 1
All settings of the restriction system in Tariscope are performed as before, except for selecting a script and installing the TSconnector application.
Download the appropriate application from the Tariscope website:
for Windows (tsconnector.zip) or Linux (tsconnector.tar.gz), depending on which operating system you have 3CX installed on.
For the TSconnector application to work, you need a configuration file from 3CX: 3CXPhoneSystem.ini
On Windows, this file should be in the folder: C:\ProgramData\3CX\Bin
On Linux, this file should be in the directory: /var/lib/3cxpbx/Bin/
The interaction of the script for setting/removing restrictions, which runs in Tariscope Observer, with the TSconnector application is performed using the TCP protocol.TSconnector works as a TCP server, and the Tariscope Observer script, as a TCP client. The IP port through which the TSconnector application’s TCP server operates is specified in the config.json file, which is part of the TSconnector application. By default, IP port 8089 is used. The user can change it as desired.
Make sure this port is open on both the 3CX server, where the TSconnector application is installed, and the Tariscope server.
Installing the application for Windows
Unzip the tsconnector.zip archive to a folder, for example: C:\TSconnector
Copy the 3CXPhoneSystem.ini file to this folder.
TSconnector performs actions to set or remove restrictions, depending on what commands it receives from Tariscope.
The TSconnector application has only one setting: the TCP/IP port on which its TCP server runs. The default IP port is 8089.
If you want to change it, open the config.json file in a text editor, which is located in the folder where the archive was unpacked.
In the line "IPPort": "8089", change the value of 8089 to the desired one.
Open the Windows Command Prompt with administrator rights. Create a Windows service with the following command:
sc create TSconnector binpath= [path to the tsconnector.exe]
For example, if you unzipped the archive to the C:\TSconnector folder, this command should look like this:
sc create TSconnector binpath= C:\TSconnector\ tsconnector.exe
Start this service with the following command:
sc start TSconnector
If the service starts successfully, a TS_restrictions.log application log file will be created in the folder where the TSconnector application is unpacked. Check its contents to make sure it does not contain any errors.
During a normal startup, the application log will contain lines similar to the following:
===========================================
05.03.2026 15:33:43 The TSconnector service has been launched.
05.03.2026 15:33:43 Lookup for 3CXPhoneSystem.ini...
The current folder is C:\temp\TSconnector\
Reading the 3CXPhoneSystem.ini file
Path to the 3CX folder: C:\Program Files\3CX Phone System\Bin
IP port: 8089
C:\Program Files\3CX Phone System\Bin\3cxpscomcpp2.dll
3CX Connection options: 5485, cfguser_default, gev4y8qyjn4ja
C:\Program Files\3CX Phone System\Bin\3cxpscomcpp2.XmlSerializers.dll
05.03.2026 15:33:45 Connection to 3CX API has been completed
05.03.2026 15:33:48 Server has been started on the port = 8089
Waiting for a connection from a client
The last line means that TSconnector is waiting for a TCP connection from a client, namely the Tariscope Observer script.
Installing the application for Linux
Unzip the tsconnector.tar.gz archive to a directory, for example: /home/softpi/TSconnector (where softpi is the username you used to log in to the system).
Copy the 3CXPhoneSystem.ini file to this directory.
Make the TSconnector file executable. To do this, in the Terminal, go to the directory where you unzipped TSconnector and run the command:
chmod +x TSconnector
Create a unit file for the Linux service, for example, with the name ts-connector.service
This file should contain the following lines:
[Unit]
Description=Tariscope restrictions
[Service]
Type=simple
ExecStart=/home/softpi/TSconnector/TSconnector
[Install]
WantedBy=multi-user.target
Comments on the file content:
Description can be arbitrary.
ExecStart is a path to the TSconnector file from the archive.
Copy this file to the /etc/systemd/system directory:
sudo cp /home/softpi/TSconnector/ts-connector.service /etc/systemd/system
Restart Linux services. Please note that all services will be restarted, including 3CX services. Therefore, choose the appropriate time for this.
sudo systemctl daemon-reload
Check the status of the ts-connector daemon (if you create a unit file for the service with a different name, use that name in the next command):
sudo systemctl status ts-connector
If the service is inactive, start it.
sudo systemctl start ts-connector
If everything is done correctly, the status should be "active". In this case, a service log will be created. The service log of TS_restrictions.log will be in the directory where you unpacked the archive.
Configuring the Tariscope script
In Tariscope, select Data Collection/Observer -> Observer management.
On the Data Collection/Observer page, select the row from the Observer that works with 3CX v20.
On the toolbar, click the Edit icon and select Observer Scripts.
In the Event list, select the required one, for example, Change class of service, which meets the terms of the Tariscope license.
In the Script list, select: setcos-subscriber-3cx-v20.cs
Click the Edit icon. The Edit window will appear where the script text will be displayed.
Find the following lines there and make the appropriate changes:
const string TCPserverIPaddress = "127.0.0.1";
const int TCPserverIPport = 8089;
For the TCPserverIPaddress constant, specify the IP address of the server where 3CX is installed.
For the TCPserverIPport constant, specify the IP port that you set for TSconnector to work.
Save the changes.
After that, if all other settings of the restriction system in Tariscope are made, you can start Observer. After starting Tariscope Observer, open its log.
The log should contain the line:
Observer script compilation successful!
Which means that the script does not contain errors and is ready to work.
How to quickly check that the restriction feature is working
In order not to wait for one of the subscribers to exhaust the call limit set for him, you can quickly check the operation of the limitation function in the following way.
Create a test subscriber who will have a phone number on 3CX, and for whom you need to set any limitation in Tariscope.
Select the Subscribers page in the menu, on this page the line with the test subscriber.
Click on the Restrictions icon on the toolbar.
On the page that appears, select the line with the limitation parameters in the table and click on the Manually change status icon (Figure 2).

Figure 2
As a result, a command will be sent to the Observer script to prohibit the subscriber from making calls via external lines, which will transmit this command to TSconnector.
To check whether the command was executed, try to make an external call from this number. You can also view the value of the corresponding flag in the settings of this number in 3CX.
In addition, information about the execution of the command will appear in the Observer and TSconnector logs.
If the command is executed, then to return the status of the number to make external calls, click the Manually change status icon again.
The restriction on making calls will be removed.
