Rtpengine

From 탱이의 잡동사니
Revision as of 12:11, 9 July 2020 by Pchero (talk | contribs)
Jump to navigation Jump to search

Overview

RTPEngine 내용 정리.

Basic

RTPEngine 은 RTP media stream proxy 서버이다.

Installation

Required packages

pkg-config
GLib including GThread and GLib-JSON version 2.x
zlib
OpenSSL
PCRE library
XMLRPC-C version 1.16.08 or higher
hiredis library
gperf
libcurl version 3.x or 4.x
libevent version 2.x
libpcap
libsystemd
spandsp
MySQL or MariaDB client library (optional for media playback and call recording daemon)
libiptc library for iptables management (optional)
ffmpeg codec libraries for transcoding (optional) such as libavcodec, libavfilter, libswresample
bcg729 for full G.729 transcoding support (optional)

추가적으로 다음의 패키지들도 필요하다.

libconfig-tiny-perl
module-assistant
libxmlrpc-c++8-dev
linux-*-$(uname -r)

때때로 아래와 같은 에러가 나오면서 실행이 안되는 경우가 있는데, 이럴땐, linux-*-$(uname -r) 패키지 설치 후 다시 빌드를 진행하면 해결된다.

[1581510173.595075] ERR: FAILED TO CREATE KERNEL TABLE 0 (No such file or directory), KERNEL FORWARDING DISABLED
[1581510173.595925] CRIT: Fatal error: Failed to open UDP control connection port

Kernel Module

The kernel module supports multiple forwarding tables which are identified through their ID number. By default, up to 64 forwarding tables can be created and used, giving them the ID numbers 0 through 63.

Each forwarding table can be thought of a separated proxy instance. Each running instance of the rtpengine daemon controls one such table, and each table can only be controlled by one running instance of the daemon at any given time. In the most common setup, there will be only a single instance of the daemon running and there will be only a single forward table in use, with ID zero.

The kernel module can be loaded with the command.

$ modprove xt_RTPENGINE

With the module loaded, a new directory will appear in /proc, namely /proc/rtpengine/. After loading, the directory will contain only two pseudo-fils, control and list. The control file is write-only and is used to create and delete forwarding tables, while the list file is read-only and will produce a list of currently active forwarding tables. With no tables active, it will produce an empty output.

The control pseudo-file supports to commands, add and del, each followed by the forwarding table ID number. To manually create a forwarding. table with ID 42, the following command can be used.

$ echo 'add 42' > /proc/rtpengine/control

After this, the list pseudo-filie will produce the single line 42 as output. This will also create a directory called 42 in /proc/rtpengine/, which contains additional pseudo-files to control this particular forwarding table.

To delete this forwarding table, the command 'del 42' can be issued like above. This will only if no rtpengine daemon is currently running and controlling this table.

Each subdirectory /proc/rtpengine/$ID/ corresponding to each forwarding table contains the pseudo-files blast, control, list and status. The control file is write-only while the others are read-only. The control file will be kept open by the rtpengine daemon while it's running

Control scripts

rtpengine-ctl

See also