Install on a Linux Distribution
Prerequisites
Set up the following before the installation:
- A Redis instance.
- A a PostgreSQL instance.
- Install .NET 8.0. LiveSwitch for Linux is built on the .NET SDK. Instructions for the installation vary based on the distribution of your Linux host. Follow instructions from Microsoft to install .NET on Linux.
- Install libfontconfig1 that the LiveSwitch Media Server requires.
On Debian-based Linux distributions (for example, Ubuntu), run:
sudo apt-get update sudo apt-get install libfontconfig1
On RHEL-based Linux distributions (for example, CentOS), run:
sudo yum check-update sudo yum install libfontconfig1.so.1
Install the Services
The default installation installs three LiveSwitch core services in the /opt/liveswitch
directory, and the services run on systemd
. You may run the services in another unit. The following instructions show how to install the services as systemd
service units:
Unzip the tarball to the
/opt
directory:sudo tar -xvzf liveswitch.tar.gz -C /opt
Open the following configuration files:
/opt/liveswitch/gateway/FM.LiveSwitch.Gateway.Service.config.json
/opt/liveswitch/media-server/FM.LiveSwitch.MediaServer.Service.config.json
/opt/liveswitch/sip-connector/FM.LiveSwitch.Connector.Sip.Service.config.json
/opt/liveswitch/recording-monitor/FM.LiveSwitch.Recording.Monitor.Service.config.json
/opt/liveswitch/recording-muxer/FM.LiveSwitch.Recording.Muxer.Service.config.json
/opt/liveswitch/recording-mover/FM.LiveSwitch.Recording.Mover.Service.config.json
Edit ConnectionStrings to match the connection strings for your PostgreSQL and Redis instances:
"ConnectionStrings": { "Default": "postgresql://<postgresql_connection_string>", "Cache": "redis://<redis_connecting_string>", "RecordingStorage": "postgres://<postgresql_connection_string>", "RecordingQueue": "amqp://<rabbitmq_connecting_string>" }
The connection strings you must edit depends on the services you install:
Default
: Required for all services.Cache
: Optional for all services.RecordingStorage
: Optional and used only by Recording Management services like Recording Monitor, Recording Mover, and Recording Muxer.RecordingQueue
: Optional and used only by Recording Management services like Recording Monitor, Recording Mover, and Recording Muxer.
See the formats of the PostgreSQL connection string, Redis connection string, and RabbitMQ connection string. An example is shown below:
"ConnectionStrings": { "Default": "postgresql://user:password@10.37.129.2:25061/postgres_server?sslmode=require&Server_Compatibility_Mode=Redshift", "Cache": "redis://lxjis.redis.cache.windows.net:6380,password=2KfYkEQOCYH8sdfdsfdsfdsEdMV18nSvtE4FrMqnncAFZNsRc=,ssl=True,abortConnect=False", "RecordingStorage": "postgres://user:password@10.37.129.2:5432/recording", "RecordingQueue": "amqp://user:password@10.37.129.2:5672" }
Symlink LiveSwitch services into the
systemd
service unit directory:sudo ln /opt/liveswitch/gateway/gateway.service /etc/systemd/system/gateway.service sudo ln /opt/liveswitch/media-server/media-server.service /etc/systemd/system/media-server.service sudo ln /opt/liveswitch/sip-connector/sip-connector.service /etc/systemd/system/sip-connector.service sudo ln /opt/liveswitch/recording-monitor/recording-monitor.service /etc/systemd/system/recording-monitor.service sudo ln /opt/liveswitch/recording-muxer/recording-muxer.service /etc/systemd/system/recording-muxer.service sudo ln /opt/liveswitch/recording-mover/recording-mover.service /etc/systemd/system/recording-mover.service
Note
systemd
may end processes that consume a lot of system resources. You must configure the server that thesystemd
doesn't stop LiveSwitch services.Once the services have been symlinked, use
systemctl
to enable them and then reload thesystemd
daemon:sudo systemctl enable gateway sudo systemctl enable media-server sudo systemctl enable sip-connector sudo systemctl enable recording-monitor sudo systemctl enable recording-muxer sudo systemctl enable recording-mover sudo systemctl daemon-reload
If the services have not started, start them with
systemctl
:sudo systemctl start gateway sudo systemctl start media-server sudo systemctl start sip-connector sudo systemctl start recording-monitor sudo systemctl start recording-muxer sudo systemctl start recording-mover
Check if the installation is successful by visiting the LiveSwitch Console at http://localhost:9090/admin.