Skip to main content

RTPengine media relay (rtpengine)

Optional RTP relay driven by Kamailio: media anchoring, difficult NAT and media interconnection with carriers. Userspace forwarding, ng control protocol on the admin address, Prometheus metrics on demand.

Generated from catalog/services/rtpengine.yaml: do not edit by hand.

Summary​

Version11.5.1.18
Useinstall and configure
Layerinfrastructure (shown apart)
CategoryNetwork
Installation methodspackage
External connectionno
Sandbox onlyno

Licence​

SPDX identifierGPL-3.0-or-later
Licence policylicence exception
Licence exceptionLEX-026 (pending, awaiting the client)
Licence noteGPL-3.0-or-later with the OpenSSL linking exception of Sipwise (debian/copyright of the project; SPDX lists no identifier for this exception): a separate daemon controlled over its ng network protocol; no RTPengine code is linked into Navin. The offline bundle redistributes the distribution packages with their notices and sources.
Platform componentrtpengine

Packages and artifacts​

A package the project of the service publishes (its image, its binary archive, its Python or OS package) carries the licence of the service; a third-party package carries the licence written on its row, read from the official upstream metadata.

KindPackageVersionLicenceDetails
OS packagertpengine-daemonversion of the configured repositoryGPL-3.0-or-laterDebian family (apt)
OS packagertpengine-utilsversion of the configured repositoryGPL-3.0-or-laterDebian family (apt)

Supported systems and architectures​

MethodOperating systemsArchitectures
packageDebian family (apt)x86_64, aarch64 (not restricted by the descriptor)
  • No package method on the RHEL family (dnf): No RTPengine package exists in RHEL nor in EPEL 9 and 10 (the Sipwise project publishes Debian packages only). Place the media relay on Ubuntu 24.04 (universe: rtpengine-daemon 11.5.1.18) or Debian 13 (rtpengine-daemon 12.5.1.31).
  • Method package on the Debian family (apt) limited to Ubuntu 24.04, Debian 13: The rendered configuration is validated against the RTPengine of Ubuntu 24.04 (11.5.1.18) and Debian 13 (12.5.1.31) only; the older releases of Debian 12 and Ubuntu 22.04 are not part of the offline mirror of the telephony.

Units of the distribution masked by the method package: rtpengine-daemon.service. The postinst of the packages starts them with the stock configuration: right after the install the agent stops, disables and masks them (task systemd.mask, only when their unit file belongs to an installed package), and the component runs from its own unit navin-<service>-<component>.service. The uninstall only unmasks them.

Certified host systems: RHEL 8/9/10, Rocky Linux 8/9/10, AlmaLinux 8/9/10, Oracle Linux 8/9, CentOS Stream 9/10, Ubuntu 22.04/24.04, Debian 12, Arch Linux (rolling). The host preflight accepts these systems (other releases of a known family give a warning, end of life releases are refused) and the x86_64 and aarch64 architectures.

Prerequisites​

Host​

The descriptor declares no host preflight check.

Programs the commands and checks of the service start on the host, outside the managed roots: add them to allowed_commands of the agent (see Security of the Navin agent), else the agent refuses them with command_not_allowed: /usr/bin/rtpengine-ctl.

Network and ports​

ComponentPort namePortOpened in the host firewall
rtpengineng2223/udpyes
rtpenginemedia30000-39999/udpyes
rtpenginemetrics2224/tcpyes
rtpenginecli9900/tcpno

Services and connections needed​

This service has no dependency.

Installation methods and modes​

MethodDefaultWhat the method uses
packageyesthe OS packages of the descriptor, installed by the package manager of the host

Components​

ComponentKindInstallation methodsPorts
RTPengine (rtpengine)masterpackage2223/udp, 30000-39999/udp, 2224/tcp, 9900/tcp

Single (single) (default)​

One media relay.

What the mode deploys:

ComponentPlacement
rtpenginemin 1, max 1

Redundant (redundant)​

Two or more independent relays used in turn by Kamailio; a lost relay drops the media of its calls.

What the mode deploys:

ComponentPlacement
rtpenginemin 2, recommended 2

Install this service​

The install wizard of the Navin Manager plans, validates and runs the installation; you need the services:install permission on the cluster.

  1. Open the wizard. In Clusters, choose the row action Install services of the target cluster. The wizard opens on its first step, Service.

  2. Choose the service. On the Service step, select RTPengine media relay. The card shows the licence GPL-3.0-or-later.

  3. Choose the hosts and the mode. On the Hosts step, tick the hosts, then choose the Mode: single (default), redundant. Each mode deploys the components listed in Installation methods and modes.

  4. Bindings. This service has no dependency: the Bindings step has nothing to bind.

  5. Configure. On the Configure step, review the parameters (see Configuration parameters). Passwords left empty with a generated default are generated and sealed by the Manager.

  6. Review and install. On the Install step the Manager validates the plan and shows the installation order; when it says "The plan is valid. Ready to install.", choose Install. A highly available mode is installed only when its HA checks pass.

  7. Verify. The operation ends when the health checks of every instance pass (see Health checks); the service then shows as running in Services.

High availability​

Clusternone (none)
High availabilityredundancy (redundancy)
Failoverclient side (client)
Replicationnone (none)
Quorumnone (none)
Discoverystatic (static)
Entry pointclient discovery (client-discovery)
Official documentationhttps://rtpengine.readthedocs.io/en/latest/overview.html
Referenceshttps://www.kamailio.org/docs/modules/5.7.x/modules/rtpengine.html

Topology per mode​

ModesHighest catalog levelDistributionQuorum componentFault domainsDescription
singlestandalone (standalone)single (single)-1One relay: its loss drops the media of the calls it anchors.
redundantha (ha)active-active (active-active)-2Independent relays; Kamailio sends each new call to an available one.

Notes​

  • When it is justified: RTP anchoring on the SIP edge (lawful or topology hiding requirements), phones or carriers behind a NAT that Asterisk cannot traverse, media interconnection between networks that do not route to each other. When it is not: Asterisk anchors the media of the PBX calls itself and LiveKit SIP the media of the AI calls; the WebRTC softphones talk DTLS-SRTP with Asterisk, never through RTPengine.
  • The relays share no state (no Redis configured): the calls of a lost relay lose their media; new calls go to the others.

Configuration parameters​

Network​

ParameterTypeDefaultAllowed valuesRequiredSecretRestartDescription
ng port (ng_port)port2223-nonoyesUDP control port of the ng protocol on the admin address. ng has no authentication: keep the admin address on a network reached by the Kamailio hosts only.
Admin address (admin_address)string(empty)-nonoyesAddress of the ng and HTTP listeners; empty: the address of the host. (scope host)
HTTP metrics (metrics_enabled)boolfalse-nonoyesOpens the HTTP listener: Prometheus /metrics, but also the command interface under /cli, without authentication; restricted to the hosts of the cluster by the host firewall.
HTTP port (http_port)port2224-nonoyesPort of /metrics on the admin address, while HTTP metrics are on.
CLI port (cli_port)port9900-nonoyesLoopback port of rtpengine-ctl (commands of the Manager).

Media​

ParameterTypeDefaultAllowed valuesRequiredSecretRestartDescription
Media address (media_address)string(empty)-nonoyesLocal address the RTP ports bind to; empty: the address of the host. (scope host)
Advertised address (advertised_address)string(empty)-nonoyesPublic address written in the SDP when the host is behind a 1:1 NAT; empty: the media address. (scope host)
First RTP port (port_min)port30000min 1024, max 39000nonoyesFirst UDP port of the media range, which ends at 39999 (public, two ports per relayed leg).
RTP timeout (rtp_timeout_s)int60min 10, max 3600nononoSeconds without media before a call is closed.
On hold timeout (silent_timeout_s)int3600min 60, max 86400nononoSeconds without media for a call on hold (sendonly) before it is closed.
Maximum call duration (max_call_duration_s)int14400min 60, max 86400nononoSeconds after which a call is closed whatever its media.

Tuning​

ParameterTypeDefaultAllowed valuesRequiredSecretRestartDescription
Threads (threads)int4min 1, max 64nonoyesWorker threads relaying the media. (recommended max(2, min(32, host.cpu_count)))
Log level (log_level)int5min 1, max 7nononoSyslog level: 3 errors, 5 notices, 6 info, 7 debug.

Endpoints​

EndpointSchemeComponentPortPathTLS parameterBinding parametersBinding secretsProvisioning command
ngngrtpengine2223 (ng_port)-----

Commands​

CommandComponentTargetDescription
Sessions (sessions)rtpengineevery hostNumber of relayed sessions on every relay.
Statistics (totals)rtpengineevery hostTotals since start: sessions, packets, errors, timeouts.

Health checks​

Liveness (per instance)​

ComponentCheckDetails
rtpengineTCP 127.0.0.1:{{ config.cli_port }}20 retries; interval 1 s; timeout 3 s

Readiness (service check)​

CheckDetails
/usr/bin/rtpengine-ctl -ip 127.0.0.1 -port {{ config.cli_port }} list numsessionsExpected Current sessions; 10 retries; interval 3 s; timeout 10 s

Preflight checks​

CheckTypeMeaningSeverityComponents
ng_port_freeport_free {"param": "ng_port"}port 2223 free on the hostblockingevery component

Uninstall​

Paths removed when the data is purged: {{ paths.log }}.

Upstream documentation​