Kurento Media Server Implementation


Officially supported platforms: Ubuntu 20.04 (Focal) (64-bits)


sudo apt-get update ; sudo apt-get install --no-install-recommends \    gnupg

 

gnupg ( The GNU Privacy Guard ) : allows you to encrypt and sign your data and communications; it features a versatile key management system, along with access modules for all kinds of public key directories.

  • Add the Kurento repository to your system configuration:
source /etc/upstream-release/lsb-release 2>/dev/null || source /etc/lsb-release sudo apt-key adv \    --keyserver hkp://keyserver.ubuntu.com:80 \    --recv-keys 234821A61B67740F89BFD669FC8A16625AFA7A83 

 

     sudo tee "/etc/apt/sources.list.d/kurento.list" >/dev/null <<EOF   # Kurento Media Server - Release packages   deb [arch=amd64] http://ubuntu.openvidu.io/7.0.0 $DISTRIB_CODENAME main   EOF  

 

  • Install KMS ( Kurento Media Server ) :

 

sudo apt-get update ; sudo apt-get install --no-install-recommends \    kurento-media-server

 

  • Starting kms:

 

       sudo service kurento-media-server start  

 

STUN/TURN :

Kurento Media Server, just like any WebRTC endpoint, will work fine on its own, for LAN connections or for servers which have a public IP address assigned to them. However, sooner or later you will want to make your application work in a cloud environment with NAT firewalls, and allow KMS to connect with remote clients. At the same time, remote clients will probably want to connect from behind their own NAT router too, so your application needs to be prepared to perform NAT Traversal in both sides. This can be done by setting up a STUN server or a TURN relay, and configuring it in both KMS and the client browser.

Add these two lines in /etc/kurento/modules/kurento/WebRtcEndpoint.conf.ini

stunServerAddress=stun.l.google.com

stunServerPort=19302

 

Coturn:

Coturn is a STUN server and TURN relay, supporting all features required for the ICE protocol and allowing to establish WebRTC connections from behind a NAT.

 

Coturn Installation:

sudo apt-get update ; sudo apt-get install --no-install-recommends \    coturn

 

Coturn configuration:

nano /etc/turnserver.conf 

 

Uncomment these lines:

# STUN listener port for UDP and TCP. 
listening-port=3478
 # Uncomment to enable moderately verbose logs.
# Default: verbose mode OFF.
#verbose 
# TURN fingerprints in messages.
fingerprint 
# TURN long-term credential mechanism.
lt-cred-mech 
# TURN static user account for long-term credential mechanism.
user=username:password # TURN realm used for the long-term credential mechanism.
realm= DOMAIN-NAME # Set the log file name.
# The log file can be reset sending a SIGHUP signal to the turnserver process.
log-file=/var/log/turn.log
# Disable log file rollover and use log file name as-is.
simple-log
syslog

 

  • Create the destination log file, otherwise Coturn will not have permissions to create the file by itself:

sudo install -o turnserver -g turnserver -m 644 /dev/null /var/log/turn.log

  1. Edit the file /etc/default/coturnand uncomment or add this line:
  2. TURNSERVER_ENABLED=1
  3. Restart the Coturn system service:

sudo service coturn restart

 

set turnURL to use a TURN server; in /etc/kurento/modules/kurento/WebRtcEndpoint.conf.ini

turnURL=username:password@ip_serveur:3478

  1. Restart KMS:

sudo systemctl restart kurento-media-server

sudo systemctl status kurento-media-server


Avez-vous trouvé cet article utile ?