Installation

Components

To install the LiveSwitch server, make sure your machine meets the server requirements

The following diagram shows the LiveSwitch server components that are necessary for your client application to run.



Components Usage Requirements
Redis Stores ephemeral data
  • Version 3.2.100 or newer
  • You must disable cluster mode because LiveSwitch doesn't support cluster mode and won't work properly if cluster mode is configured.
PostgreSQL Stores configuration data 

Version 11 or newer

Gateway

Connects the various parts of LiveSwitch

At least one Gateway is required
Media Server Manages SFU and MCU sessions At least one Media Server is required
SIP Connector

Allows LiveSwitch to connect to SIP endpoints

Optional


LiveSwitch v1.11 and earlier uses Redis to store configuration data. In LiveSwitch v1.12,  you have the option to use PostgreSQL. It's highly recommended that you use PostgreSQL because using Redis to store configuration data is deprecated and will be removed in a future release.

Install Using Docker

Docker is a tool designed to make it easier to create, deploy, and run applications using containers. LiveSwitch provides Gateway and Media server docker images with all the required dependencies to make it easier for you to install and run a LiveSwith service in a docker container. This is incredibly convenient to roll out a cluster environment.

To install LiveSwitch using docker, click the links below and follow the quick start guide:

  1. Gateway servers: https://hub.docker.com/r/frozenmountain/liveswitch-gateway
  2. Media Servers: https://hub.docker.com/r/frozenmountain/liveswitch-media-server
  3. SIP Connector: https://hub.docker.com/r/frozenmountain/liveswitch-sip-connector
  4. Check if the installation is successful by visiting the LiveSwitch Console page at http://localhost:9090/admin.

Install on Windows

Prerequisites

  1. Set up a Redis instance.
    • For standalone installation on Windows, setting up a Redis instance is optional. The installer can install a Redis instance on your local machine.
  2. Set up a PostgreSQL instance.

Install the Services

  1. Run the FM.LiveSwitch.Installer.msi file from the LiveSwitch download package. 
  2. LiveSwitch requires .NET Framework 4.6.1 or newer. You are asked to install it during the LiveSwitch installation if you don't have it.
  3. Select the installation type:
    • To install all the LiveSwtich servers on the local machine for development, select Standalone Server.
    • To install each server component on a different machine and/or set up a server cluster, select Cluster, and then specify the installed components on the local machine.
  4. When prompted, enter the PostgreSQL connection string and the Redis connection string, or the hostname, port, database name, password, etc.

    PostgreSQL connection string parameters must be URL encoded. For example, if your PostgreSQL connection string is: "postgres://username@domain.com:password@host:5432/database", you should encode it to "postgres://username40%domain.com:password@host:5432/database" because @ is the reserved character by the connection string.

  5. Follow the instructions to finish the installation.
  6. Check if the installation is successful by visiting the LiveSwitch Console page at http://localhost:9090/admin.

Installation Results

You can find the installed components at C:\Program Files\Frozen Mountain Software\LiveSwitch. This directory contains up to four sub-directories, depending on the product features that you have installed. If you have installed Gateway, SIP Connector, or Media Server, the corresponding services are also installed as "LiveSwitch Gateway," "LiveSwitch SipConnector" and "LiveSwitch MediaServer." The services start automatically when your machine starts.

Application Default HTTP URL Default HTTPS URL
LiveSwitch Gateway http://localhost:8080/sync

https://localhost:8443/sync

LiveSwitch Media Server n/a  n/a 
LiveSwitch Console http://localhost:9090/admin

https://localhost:9443/admin

LiveSwitch SIP Connector n/a n/a 

You can uninstall LiveSwitch using Programs and Features on Windows.

Install on a Linux Distribution

Prerequisites

  1. Set up a Redis instance.
  2. Set up a PostgreSQL instance.
  3. Install .NET Core v3.1. LiveSwitch for Linux is built on the .NET Core SDK. Instructions for the installation vary based on the distribution of your Linux host. Follow instructions from Microsoft to install .NET on Linux.
  4. Install libfontconfig1 that the LiveSwitch Media Server requires. 
    • On Debian-based Linux distributions (e.g., Ubuntu), run:

      sudo apt-get update
      sudo apt-get install libfontconfig1
    • On RHEL-based Linux distributions (e.g., CentOS), run:

      sudo yum check-update
      sudo yum install libfontconfig1.so.1

Install the Services

The default installation installs three LiveSwtich 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:

  1. Unzip the tarball to the /opt directory:

    sudo tar -xvzf liveswitch.tar.gz -C /opt
  2. Open the following configuration files:  in the following config 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
  3. Edit the "ConnectionStrings" to the connection strings for your PostgreSQL and Redis instances. This field is mandatory, and all your LiveSwitch services must connect to the same database instances. 

    "ConnectionStrings": {
            "Default": "postgresql://<postgresql_connection_string>",
            "Cache": "redis://<redis_connecting_string>"
    }

    See the formats of the PostgreSQL connection string and the Redis 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"
      }
  4. 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

    Systemd may terminate processes that consume a lot of system resources. You must configure the server that the systemd does not terminate LiveSwitch services.

  5. Once the services have been symlinked, use systemctl to enable them and then reload the systemd daemon:

    sudo systemctl enable gateway
    sudo systemctl enable media-server
    sudo systemctl enable sip-connector
    sudo systemctl daemon-reload
  6. If the services have not started, start them with systemctl:

    sudo systemctl start gateway
    sudo systemctl start media-server
    sudo systemctl start sip-connector
  7. Check if the installation is successful by visiting the LiveSwitch Console page at http://localhost:9090/admin.

Installation Troubleshooting

Services Failed to Start

The best resources for troubleshooting issues during installation are the logs.  The logs provide information about why the services failed to start. For most installations, you can find logs at:

  • Windows: "%ProgramData%\Frozen Mountain Software\-service-\"
  • LInux: "/var/log/fm/liveswitch/-service-/"

If they are not there, then check your Logging Configuration.

For Linux installation, if the Gateway service can't start, you can manually run it on the console:

  1. Stop the service:

    sudo systemctl stop gateway


  2. Run the Gateway service:

    cd /opt/liveswitch/gateway
    dotnet FM.LiveSwitch.Gateway.Core.dll

Unable to Connect to Redis or PostgreSQL Server

If the service can't connect to the Redis or PostgreSQL server, check the following:

  1. Confirm that the correct Redis or PostgreSQL connection string has been set in your Server Specific Configuration file.
  2. Check that the Redis or PostgreSQL server is up and running.
  3. Check that the LiveSwitch Gateway service can access the Redis or PostgreSQL server over the network.

Ports are Already in Use

The LiveSwitch Gateway binds to ports 8080 and 9090 on the server by default.  If another application uses those ports, the LiveSwitch services won't start.  You can fix this by the following:

  •  Disable the other application or change the port it uses.

    Other Services

    Running other services on the same server as LiveSwitch could adversely affect performance.

  • If you are running multiple Gateways, access the LiveSwitch Configuration Console from a different Gateway and configure the HTTP Bindings with a different port.

  • If you cannot disable the other application, change the port that LiveSwitch uses using the LiveSwitch CLI tool:

    Windows
    FM.LiveSwitch.Cli.exe reset http --sync=<sync_port> --admin=<admin_port>
    Linux
    dotnet /opt/liveswitch/config-tool/FM.LiveSwitch.Cli.dll reset http --sync=<sync_port> --admin=<admin_port>
    
    

    Restart all the services after running the tool, and then go to the LiveSwitch Configuration Console at http://localhost:<admin_port>/admin to complete your configuration.