Setting up audio and video calls with LiveKit
This article provides information on how to set up Unblu to use LiveKit to establish audio and video calls.
How LiveKit works in general is outlined in the LiveKit documentation.
Deployment options
Unblu Cloud and LiveKit
If you’re using the Unblu Cloud, LiveKit is provided as a service out of the box and you don’t have to configure anything.
Unblu on-premises and LiveKit in the Unblu Cloud
If you have an on-premises Unblu installation, you can still use LiveKit as an Unblu Cloud service. In this case, you must configure Unblu to use LiveKit as explained below, but Unblu provides you with the server, API keys, and secrets required for LiveKit.
Take note of the following additional information:
-
The LiveKit signalling service uses
tcp/443
. You must allow WebSockets. -
LiveKit worker nodes receive direct traffic on
udp/50000-60000
. Allowing direct access to worker nodes improves latency a bit but typically isn’t possible in an enterprise environment as the worker nodes do not have static IPs. If the worker nodes aren’t directly accessible for users, the TURN server relays traffic to the worker nodes. -
The TURN server is available via
tcp/3478
,udp/3478
,tcp/5349
,udp/5349
, andtcp/443
. Technically it’s possible only to allow connections to the TURN server on certain ports. However, to improve stability you should open as many of the above ports as possible. You should open at least one UDP port unless you have very good reasons not to. -
Traffic to and from the TURN server is very sensitive to network delays. You should therefore allow direct access to the TURN server, skipping any intermediate proxy servers such as web security filters.
The endpoints of LiveKit in the Unblu Cloud are listed by region below.
europe-west4 (Netherlands) |
||
---|---|---|
Service |
Environment |
|
Stage |
Production |
|
LiveKit signalling server |
|
|
TURN server |
|
|
europe-west6 (Switzerland) |
||
---|---|---|
Service |
Environment |
|
Stage |
Production |
|
LiveKit signalling server |
|
Available on request |
TURN server |
|
|
northamerica-northeast-1 (Canada) |
||
---|---|---|
Service |
Environment |
|
Stage |
Production |
|
LiveKit signalling server |
Available on request |
Available on request |
TURN server |
|
|
us-central1 (USA) |
||
---|---|---|
Service |
Environment |
|
Stage |
Production |
|
LiveKit signalling server |
|
|
TURN server |
|
|
Unblu on-premises and LiveKit
If you choose to run LiveKit on-premises, you have to set up and deploy your own LiveKit server. For more information on how to do so, refer to the LiveKit documentation.
LiveKit offers several deployment models, such as to a single VM (not scalable, and limited to up to 3000 call participants), or to a scalable Kubernetes cluster.
If you want to deploy LiveKit to a Kubernetes cluster, you must take into account the following statement from the LiveKit documentation:
LiveKit pods require direct access to the network with host networking. This means that the rtc.udp/tcp
ports that are open on those nodes are directly handled by LiveKit server. With that direct requirement of specific ports, it means we’ll be limited to one LiveKit pod per node. It’s possible to run other workload on those nodes.
Deploy to Kubernetes: Understanding the deployment
Additionally, each node running LiveKit must have its own public IP address.
One way to meet these requirements, at least in principle, without directly exposing other nodes in the cluster to the internet is to isolate LiveKit by deploying it to a dedicated Kubernetes cluster. However, you shouldn’t underestimate the obstacles you must overcome.
Running LiveKit on a VM in your DMZ may be easier to reconcile with the IT strategy of organizations that put a premium on security.
If you have any concerns about running LiveKit on-premises, you should consider using Unblu’s LiveKit cloud service instead. For more information, contact your Unblu account manager.
Configuring Unblu to use LiveKit
Once you’ve set up your LiveKit server, configure Unblu to use it. Set the following configuration properties at the ACCOUNT
level:
-
com.unblu.messenger.callEnabled: Set to
true
to enable audio and video calls in Unblu. -
com.unblu.conversation.call.callServiceProvider: The call service provider to use for audio and video calls. Set this property to
LIVEKIT
.
-
com.unblu.conversation.call.livekit.apiUrl: URL pointing to the LiveKit server used by the Unblu server for API calls.
-
com.unblu.conversation.call.livekit.apiKey: LiveKit API key used to identify Unblu with LiveKit.
-
com.unblu.conversation.call.livekit.apiSecret: LiveKit API secret used by the Unblu server to authenticate against the LiveKit server and create access tokens for the clients.
-
com.unblu.conversation.call.livekit.accessTokenTimeout: Timeout, in seconds, for call access tokens that are handed out by the Unblu server to the clients (browsers) so they can connect to a LiveKit call.
-
com.unblu.conversation.call.livekit.serverUrl: LiveKit signaling server URL used by the clients (browsers) to connect to the LiveKit server.
-
com.unblu.conversation.call.livekit.customTurnEnabled: Set to
true
to use a custom TURN server for LiveKit. That way, Unblu establishes audio and video calls using the TURN server or servers specified in the configuration property com.unblu.webrtc.iceServers. Otherwise, the LiveKit TURN server is used.LiveKit isn’t compatible with all TURN servers. -
If your Unblu deployment accesses external services through a forward proxy, and LiveKit is deployed as an external service, provide Unblu with URL of the proxy in the configuration property com.unblu.conversation.call.livekit.apiProxyUrl.
-
Select other options as required. See the Conversation call section of the configuration properties reference for an overview of the available options.
Video chat limitations
-
If a visitor navigates to a new page inside the Unblu-instrumented web page, the video connection is disrupted while the page loads and automatically re-establishes a connection as soon as possible. To work around this, visitors can use the pop-out feature.
-
The video chat can only be displayed in one browser window or tab. If the visitor has several tabs or windows open and they belong to the same Unblu conversation, the video chat stays in one window. If the user wants to transfer the video chat to a different window, they can do so in the chat user interface.
-
Currently, Unblu only supports up to six concurrent video chat participants.
-
Audio level indicators aren’t supported. A workaround is in place to indicate if a participant is speaking.
See also
-
Visit the LiveKit browser test page to check your browser’s WebRTC capabilities.
-
For more information about data encryption, refer to the article about call service providers.
-
If you want to record and archive audio and video calls, refer to conversation recording.
-
If you use LiveKit for calls, you may also want to use it for screen sharing. Refer to the article Setting up screen sharing with LiveKit for more information.