Sign inSign up

frozenmountain/liveswitch-media-server

By frozenmountain

•Updated about 2 months ago

LiveSwitch Media Server releases.

Image
1

100K+

frozenmountain/liveswitch-media-server repository overview

The LiveSwitch Media Server accepts inbound WebRTC-compatible streaming audio, video, and data connections from the LiveSwitch client SDK and the liveswitch-connect⁠ command-line interface (CLI) as well as telephones via the LiveSwitch SIP Connector.

⁠Quick Start

First, set up your LiveSwitch Gateway⁠.

Next, start your LiveSwitch Media Server docker image:

sudo docker run -d \
    --env CONNECTIONSTRINGS:DEFAULT='postgres://postgres:[email protected]:5432/postgres' \
    --env CONNECTIONSTRINGS:CACHE='redis://127.0.0.1' \
    --env SERVICEBASEURL='http://127.0.0.1:8080' \
    --network host \
    --restart always \
    --ulimit nofile=65535:65535 \
    --name liveswitch-media-server \
      frozenmountain/liveswitch-media-server

See below for more information about the CONNECTIONSTRINGS:DEFAULT and CONNECTIONSTRINGS:CACHE environment variables.

⁠Network

The LiveSwitch Media Server requires host network access.

UDP and TCP port 3478 handle STUN⁠ and TURN⁠ traffic to help clients stream through their firewalls. TCP port 5379 is optionally available for TLS termination (TURNS) if a certificate is provided.

It is strongly recommended to enable TURNS on port 443 to ensure high-availability for streaming in restricted networks. Setting the EXTERNAL:PUBLICHOSTNAME environment variable is required to enable this feature.

UDP ports 49152-65535 handle real-time media flow.

⁠Configuration

The LiveSwitch Media Server has two levels of configuration.

  1. Instance configuration for settings specific to an individual server is done via environment variables or a JSON configuration file.
  2. Deployment configuration for settings that apply to all servers is done via the administration console or REST API.

⁠Instance Configuration

Environment variables are recommended for simple configuration.

If using a JSON file, it must be located at /app/FM.LiveSwitch.MediaServer.Service.config.json, e.g.:

docker cp FM.LiveSwitch.MediaServer.Service.config.json liveswitch-media-server:/app/FM.LiveSwitch.MediaServer.Service.config.json

Example JSON file:

{
  "ConnectionStrings": {
    "Default": "postgres://postgres:[email protected]:5432/postgres'",
    "Cache": "redis://127.0.0.1"
  },
  "Region": "",
  "Internal": {
    "IPAddresses": []
  },
  "External": {
    "IPAddresses": [],
    "PublicIPAddress": "",
    "PublicHostname": ""
  }
}

Environment variable names map to the JSON property names using .NET Core conventions⁠.

⁠CONNECTIONSTRINGS:DEFAULT

A postgres connection URI that matches the documentation here⁠. If not provided, the server will fail to startup.

⁠CONNECTIONSTRINGS:CACHE

A redis connection string compatible with ServiceStack.Redis⁠. If not specified, it will default to 127.0.0.1.

⁠REGION

A string value used by the LiveSwitch Gateway when selecting a LiveSwitch Media Server to process an inbound client stream. Clients that indicate a region will be matched to Media Servers with a matching value wherever possible.

⁠INTERNAL:IPADDRESSES

The local IP address(es) or CIDR range(s) for internal clustering traffic. If not specified, all network interfaces will be used.

⁠EXTERNAL:IPADDRESSES

The local IP address(es) or CIDR range(s) for external media streaming traffic. If not specified, all network interfaces will be used.

⁠EXTERNAL:PUBLICIPADDRESS

The public IP address of the current machine accessible from the outside world. If set, this overrides the automatic detection provided by the external STUN server in by the deployment configuration.

⁠EXTERNAL:PUBLICHOSTNAME

The public DNS address of the current machine accessible from the outside world. This is required when TURNS is enabled in the deployment configuration.

⁠Deployment Configuration

The administration console is accessible via the Gateway on :9090/admin by default. It can be accessed by any modern web browser.

The REST API is accessible via the Gateway on :9090/admin/api by default. LiveSwitch conforms to OData⁠ best practices. The v2 API is recommended for read/write access to configuration.

The REST API explorer is accessible via the Gateway on :9090/admin/swagger by default. Swagger⁠ allows you to explore and interact with the REST API from your web browser.

Tag summary

Content type

Image

Digest

sha256:91ef5e224…

Size

208.1 MB

Last updated

about 2 months ago

docker pull frozenmountain/liveswitch-media-server