Creating a Totalview3CX Linux service

Prerequisites

3CX must be installed and running on same machine as Totalview3CX ConnectorLinux service/daemon is targeted to be installed on.
Verify by running the following command: sudo apt list --installed | grep 3cx
It should show 3cxpbx package as installed.
Verify that 3CX services are running, by running the following command: sudo systemctl status "*3CX*"
It should output a couple of pages with information about running 3CX services.
3CX connector must be created in Totalview Admin.

Installation and Configuration Steps

  1. Create totalview user: useradd totalviewuser
  2. Create folders: /bin/3CXCore and /bin/3CXCore/Logs
  3. Locate the 3CXCore files in <InstallDir>\InstallFiles\3CXCore
  4. Copy Totalview3CX Connector files to /bin/3CXCore/ (root can be owner)
  5. Give execute permission to /bin/3CXCore/Totalview3CXCore: sudo chmod +x /bin/3CXCore/Totalview3CXCore
  6. Set totalviewuser as owner of Logs folder: sudo chown totalviewuser:totalviewuser /bin/3CXCore/Logs
  7. Edit /bin/3CXCore/config.xml set
    • PhoneSystemBinPath to the bin folder of the installed 3CX relative to the installation (e.g. ../../../var/lib/3cxpbx/Bin)
    • ServerIpAddress to the IP or DNS name of the Totalview Server
    • ServerPort to the Port of the Totalview Server
    • ConnectorName to the correct name registered in Totalview Admin

Register Daemon

  1. Edit /bin/3CXCore/Totalview3CXCore.service file (might not need any change)
    • Set correct Description
    • Set correct WorkingDirectory
    • Set correct User
    • Set correct Group
    • Set correct SystemIdentifier
  2. Copy the file to systemd cp Totalview3CXCore.service /lib/systemd/system/
  3. Reload Daemon with systemctl daemon-reload
  4. Enable the Totalview3CXCore Daemon systemctl enable Totalview3CXCore
  5. Start the Totalview3CXCore DaemonĀ  systemctl start Totalview3CXCore

Verification

To verify that Totalview3CX Connector service is starting and running without errors, view the logs in /bin/3CXCore/Logs.

The connector should also show up in Totalview Admin as running.

Service Control Commands

Start Daemon

sudo systemctl start 3CXCore

See Status

sudo systemctl status 3CXCore

Stop Daemon

sudo systemctl stop 3CXCore

Config.xml Example for Linux Daemon

<startupparameters>
  <ServerIpAddress>localhost</ServerIpAddress>
  <MaximumRetries>-1</MaximumRetries>
  <ServerPort>3333</ServerPort>
  <ConnectionTimeout>15</ConnectionTimeout>
  <ConnectorName>3CX</ConnectorName>
  <FileLogLevel>4</FileLogLevel>
  <ConnectorType>3CX</ConnectorType>
  <ReconnectInterval>20</ReconnectInterval>
  <MaximumRetries>-1</MaximumRetries>
  <FileLogLevel>4</FileLogLevel>
  <PhoneSystemBinPath>../../../var/lib/3cxpbx/Bin</PhoneSystemBinPath>
</startupparameters>

 

Last edited on February 18th, 2020