5.4 KiB
Compiling and Installing
Package Repositories
Prebuilt packages for some newer releases of Debian are available on this repository
Compiling on a Debian System
On a Debian system, everything can be built and packaged into Debian packages
by executing dpkg-buildpackage (which can be found in the dpkg-dev package) in the main directory.
This script will issue an error and stop if any of the dependency packages are
not installed. The script dpkg-checkbuilddeps can be used to check missing dependencies.
(See the note about G.729 at the end of this section.)
This will produce a number of .deb files, which can then be installed using the
dpkg -i command.
The generated files are (with version 6.2.0.0 being built on an amd64 system):
-
ngcp-rtpengine_6.2.0.0+0~mr6.2.0.0_all.debThis is a meta-package, which doesn't contain or install anything on its own, but rather only depends on the other packages to be installed. Not strictly necessary to be installed.
-
ngcp-rtpengine-daemon_6.2.0.0+0~mr6.2.0.0_amd64.debThis installed the userspace daemon, which is the main workhorse of rtpengine. This is the minimum requirement for anything to work.
-
ngcp-rtpengine-kernel-dkms_6.2.0.0+0~mr6.2.0.0_all.debKernel module, DKMS version of the package. Recommended for in-kernel operation. The kernel module will be compiled against the currently running kernel using DKMS.
-
ngcp-rtpengine-kernel-source_6.2.0.0+0~mr6.2.0.0_all.debIf DKMS is unavailable or not desired, then this package will install the sources for the kernel module for manual compilation. Required for in-kernel operation, but only if the DKMS package can't be used.
-
ngcp-rtpengine-recording-daemon_6.2.0.0+0~mr6.2.0.0_amd64.debOptional separate userspace daemon used for call recording features.
-
-dbg...or-dbgsym...packagesDebugging symbols for the various components. Optional.
For transcoding purposes, Debian provides an additional package libavcodec-extra to replace
the regular libavcodec package. It is recommended to install this extra package to offer support
for additional codecs.
To support the G.729 codec for transcoding purposes, the external library bcg729 is required. Please see the section on G.729 support below for details.
Manual Compilation
There are 3 main parts to rtpengine plus one optional component, which can be
found in the respective subdirectories. Running make on the top source
directory will build all parts. Running make check additionally will run the
test suite.
-
daemonThe userspace daemon and workhorse, minimum requirement for anything to work. Running
makewill compile the binary, which will be calledrtpengine. The following software packages including their development headers are required to compile the daemon:- pkg-config
- GLib including GThread and GLib-JSON version 2.x
- zlib
- OpenSSL
- PCRE library
- 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)
- libmosquitto
- libwebsockets
- libopus
The
Makefilecontains a few Debian-specific flags, which may have to removed for compilation to be successful. This will not affect operation in any way.If you do not wish to (or cannot) compile the optional iptables management feature, the
Makefilealso contains a switch to disable it. See the--iptables-chainoption for a description. The name of themakeswitch and its default value iswith_iptables_option=yes.Similarly, the transcoding feature can be excluded via a switch in the
Makefile, making it unnecessary to have the ffmpeg libraries installed. The name of themakeswitch and its default value iswith_transcoding=yes.Both
Makefileswitches can be provided to themakesystem via environment variables, for example by building with the shell commandwith_transcoding=no make. -
kernel-moduleRequired for in-kernel packet forwarding. Supported for kernels versions 4.4 and newer.
Compilation of the kernel module requires the kernel development headers to be installed in
/lib/modules/$VERSION/build/, where $VERSION is the output of the commanduname -r. For example, if the commanduname -rproduces the output4.19-1-amd64, then the kernel headers must be present in/lib/modules/4.19-1-amd64/build/. The last component of this path (build) is usually a symlink somewhere into/usr/src/, which is fine.Successful compilation of the module will produce the file
xt_RTPENGINE.ko. The module can be inserted into the running kernel manually throughinsmod xt_RTPENGINE.ko(which will result in an error if depending modules aren't loaded, for example thex_tablesmodule), but it's recommended to copy the module into/lib/modules/$VERSION/updates/, followed by runningdepmod -a. This copying is performed onmake install. After this, the module can be loaded by issuingmodprobe xt_RTPENGINE. -
recording-daemonOptional component for the call recording feature. Prerequisites are usage of the kernel module and availability of transcoding (via ffmpeg)