Keep a running lifetime total of all "gauge" type metrics. Also track
the square of the sums of all "gauge" type metrics in order to determine
the standard deviation.
Change-Id: I23f60774a6421636f1a913674c7d1b54a1c5f702
Starting with release 5.1, ffmpeg obsoletes the `channels` and
`channel_layout` fields, replacing them with a unified `ch_layout`
struct of type AVChannelLayout. Add wrapper defines into the
compile-time build-test headers fix_frame_channel_layout*.h to
accommodate both new and old versions.
Change-Id: I3d43b85dc3140155a61b1cf2269cda166ad88e9a
Keyspace notifications are set up before existing calls are restored
(restore_thread). Therefore the following scenario is possible:
NOTIF THREAD: receives SET, creates call
RESTORE THREAD: executes KEYS *
NOTIF THREAD: receives another SET:
NOTIF THREAD: does call_destroy(), which:
adds ports to late-release list
RESTORE THREAD: comes across call ID, does GET
RESTORE THREAD: creates new call
RESTORE THREAD: wants to allocate ports, but they're still in use
NOTIF THREAD: now does release_closed_sockets()
Use a multi-A multi-B lock to protect the two code sections from each
other and make sure that notification threads have always released all
ports before a restore thread attempts to allocate any.
Reported in #1503
Change-Id: I322062488e2ce3515c5a3e6609a5700830ac1fd4
To prevent a race condition that might miss updates about call info, set
up the Redis keyspace notifications first and then run loop to restore
calls from the existing data.
closes#1503
Change-Id: I6afa4c50fe0a34c602063fc2f45b2ee38133cf1e
Allow override the bitrate if one is already set, as opus_init()
initially sets a default bitrate, which is then overridden by codec-set.
Change-Id: Id0253d23a8f5de977e30d296872ea1df01fdbfbc
The PT tracker doesn't distinguish between audio/media types and
supplemental types, so in order not to break DTMF handling we must take
all combinations of primary (audio/media) types and supplemental types
as both input types and handler types into account.
Fix-up for 74075f6396
Fix-up for I57e1278e4fad157083d9526d4829f2940581687f
closes#1508
possibly also #1504
Change-Id: If7b242def2d35fbed14b11d204ea328b8bfe5d79
Switch from the unconditional installation of the xtables module to
do that through debhelper fragment files. This makes sure we only do
that whenever we are building these packages, and thus do not fail
to install into a non-existent directory.
Change-Id: Ib7d96a9636435d030c42f265214cc1546e373699
Fix `SC2043 (warning): This loop will only ever run once. Bad quoting or missing glob/expansion?`
Fix-up for git rev de8b3d59c1,
AKA Change-Id If75b6c1b675c8abf0bb33ae58b41e036276f8640
Change-Id: I46f58da69a683ed2fa67c86f9928fbfc8372482f
/var/spool/rtpengine is used by the main daemon as well as the recording
daemon. The recording daemon is not really useful without the main
daemon, while it's perfectly fine to use the main daemon without the
recording daemon. That directory should therefore be managed by the main
daemon package.
This fixes a broken systemd unit stemming from a missing directory if
the recording daemon is not installed.
Fix-up for 26bf2b05a5
Fix-up for I4abf4df218b1ba0dc70ed8974c0661d16e0b6ea7
Fixes GH #1510
Change-Id: If75b6c1b675c8abf0bb33ae58b41e036276f8640
To safeguard against non-refcounted objects being left over in a log
info piece (e.g. a string on the stack), add this new function to pop
pieces from the stack until the desired one is removed. This is needed
in case of a unpaired log_info_* without a matching log_info_pop.
closes#1511
Change-Id: I689de14d034df779521dfdf59f923fdbf7fabc9b
To safeguard against leftover log info pieces, add additional resets
within loops that might run repeatedly.
Relevant to #1511
Change-Id: I875f1683b7dc8cee359469e8062c08c3c3e48a9d
The order between receiving the STUN success and the triggered check is
not guaranteed, therefore resolve possible race condition by expecting
the two packets in either order.
Change-Id: Ibef9907cd4116bc5f3b7d17d936007c8efcabd3b
The codec answer routine resets the codec storage and so also resets the
clock rate tracker for "touched" codecs. This leads to all codecs seen
as "not touched" in the answer routine, which in turn leads to
supplemental codecs present in the answer SDP that should not be there.
Use the "for transcoding" flag for previously present codecs to retain
the "touched" status across the codec answer routine.
Change-Id: Idc4624606f7f10d7983e22ddf856432b07421157
* Use an explicitly created global event loop
* Await websocket connection closure
Relevant to #1497
Change-Id: I600189f5383ca7e5da8b45460508c1ddcddede0b
Fixes:
| Warning: using insecure memory!
as triggered via libgcrypt, see
https://sources.debian.org/src/libgcrypt20/1.10.1-2/src/secmem.c/?#L283
Let's use 8388608 AKA 8MB as default, as present in systemd versions
251 and newer, see commit:
| commit 852b62507b22c0a986032a2c9fa9cc464a5b7bd2
| Author: Lennart Poettering <lennart@poettering.net>
| Date: Thu Mar 10 13:22:57 2022 +0100
|
| pid1,nspawn: raise default RLIMIT_MEMLOCK to 8M
|
| This mirrors a similar check in Linux kernel 5.16
| (9dcc38e2813e0cd3b195940c98b181ce6ede8f20) that raised the
| RLIMIT_MEMLOCK to 8M.
|
| This change does two things: raise the default limit for nspawn
| containers (where we try to mimic closely what the kernel does), and
| bump it when running on old kernels which still have the lower setting.
|
| Fixes: #16300
| See: https://lwn.net/Articles/876288/
Change-Id: I56f6d173d316386501ce8b13cc7a8ad6bea4ed26
By default we use /var/spool/rtpengine as recording directory,
so ensure we have R/W access to it.
Change-Id: I4abf4df218b1ba0dc70ed8974c0661d16e0b6ea7
Now that we run as non-root user by default, we didn't have
proper capabilities for still running under root user.
Document, what's required to do so.
NOTE: related to TT#157800 (rtpengine: run as non-root) and
TT#76552 (systemd hardening)
Change-Id: Ie9f44bb75dc63cd407b27faab2219647d079359e
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1012766
> Whilst working on the Reproducible Builds effort [0] we noticed that
> rtpengine could not be built reproducibly.
>
> Whilst it did use the value from debian/changelog, the RELEASE_DATE
> variable changed due to underlying system timezone setting. A patch
> is attached that passes -u/--utc to the call to date(1).
>
> [0] https://reproducible-builds.org/
When doing the initial answer, the packet_stream endpoint port isn't
filled in yet. Use the stream_params port instead to test for rejected
streams.
closes#1499
Change-Id: I8f315d95521f874fb8c5e6222263d017800b5fc9
When ports are closed early (while the call is still running), we must
first update a slave rtpengine with this new information (that these
ports are now closed) before actually releasing the ports ourselves. Not
doing so leads to a race condition where the master instance re-uses a
port that was just closed before the slave instance knows about the port
being closed.
We implement this using a thread-local list to keep track of ports that
were released while processing a control message, and process this list
to actually close the ports only after Redis has been updated.
Additional calls to the function to close the ports are placed in
strategic locations to make sure this is triggered in every code path.
closes#1495
Change-Id: I803f4594f30ca315da0b84c6e76893f54ca3a7c9
Instead of having to rely on external repositories (like the
ubuntu-cloud-archive/yoga-staging PPA for the debhelper v13 backport),
let's use the pkg script instead. The pkg scripts ensure that the
debian/ directory looks as expected for the according distribution. So
for executing coverity + unit-tests in the Ubuntu/focal / ubuntu-20.04
environment on GitHub, let's use pkg/deb/backports/focal for generating
the according Debian source tree.
Related change in pkg: make `wrap-and-sort` execution optional. We don't
have devscripts installed by default in Ubuntu/focal / ubuntu-20.04
environment on GitHub, while usage of wrap-and-sort can be considered
optional for our purposes.
Change-Id: Ic252b323408fab557e3f151a93f61aa8fac1a30f
ubuntu-20.04 + ubuntu-latest (currently also pointing at 20.04) don't
provide debhelper v13 (required for debhelper-compat (= 13)), therefore
our workflow fails with:
| The following packages have unmet dependencies:
| builddeps:. : Depends: debhelper-compat (= 13)
| E: Unable to correct problems, you have held broken packages.
So enable the ubuntu-cloud-archive/yoga-staging PPA,
which provides a backport of debhelper v13:
https://launchpad.net/~ubuntu-cloud-archive/+archive/ubuntu/yoga-staging/+packages
and fixes our failing unity + coverity builds on github.
While at it, using apt-get with `-qq` displays only the following
message on package installation problems:
| E: Unable to correct problems, you have held broken packages.
Whereas with `-q`, we get the actual underlying problem, being:
| The following packages have unmet dependencies:
| builddeps:. : Depends: debhelper-compat (= 13)
| E: Unable to correct problems, you have held broken packages.
Change-Id: I67439a8f2f27e902710af43ff52599c8a58a5f98
Despite this code being called from userspace, we must disable
interrupts while having ssrc_stats_lock acquired, as the same lock is
acquired elsewhere from within an interrupt context.
closes#1492
Change-Id: Ia6f31eb876ee98ad355d12f9361cbc068d008608
In commit a4ee01d27f we switched to debhelper compat level 13.
debhelper v13 isn't available in (plain) Debian buster,
and therefore the Debian pipeline for buster fails with:
| The following packages have unmet dependencies:
| builddeps:. : Depends: debhelper-compat (= 13)
Since we updated packaging for bullseye, also adapt the GitHub
actions / workflow accordingly.
Change-Id: I411a6ab16ee48c5c5fc1ca43c58c016df83e1ff7