Keep track which tags (monologues) were created together as part of an
offer/answer exchange with a separate hash table, regardless of whether
these monologues actually have tagged names or are just nameless
branches.
Change-Id: I60aa114c8caf6ecdff4705e3399f60190d04dda6
Create a dedicated struct to hold certain attributes shared by both sink
handlers and media subscriptions, as a preparation to simplify handling
these attributs.
Change-Id: I866159c33ed6d6a2873d2cf68c4906ea705d253e
This makes it possible to refactor and simplify the interface functions,
as pointers and offsets can't be utilised with bit fields.
Change-Id: I70f1ac0eca7d2ccf8e8d5f5794580163f3f5b7ad
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
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
This is useful for functions which are used both from a timer and from
other callers. These functions would reset the logging context at their
end to free the reference held by the logging context, which would
wrongly reset the logging context when the same function was called from
a different code path. Using a stack with push/pop semantics makes it
safe to use these functions from any code path.
Additionally introduce an explicit reset function that clears the entire
stack regardless of context. This reset function is called at the end of
every work iteration in every worker thread, just in case not everything
was popped from the stack.
Change-Id: I0e2c142b95806b26473c65a882737e39d161d24d
libcs are implementing changes to fix the year 2038 issue on 32 bit
platforms (see [1]). musl libc already went ahead and implemented it,
starting with musl-1.2.0 (see [2]).
This commit adds a new definition to lib/loglib.h:
TIME_T_INT_FMT
If __USE_TIME_BITS64 is defined (by a time64 libc, see [1]), it's set to
the proper conversions for type int64_t, PRId64. If __USE_TIME_BITS64 is
not defined, the status quo remains unchanged ("%ld" is used).
The new definition is used in the different parts of rtpengine, where
appropriate.
Note: Richard confirmed that the "%u" format in daemon/cdr.c is not
needed, so this gets swept under the rug.
These changes get rid of the new warnings that appeared with musl-1.2.0.
Below an example warning:
In file included from ./log.h:6,
from ../include/obj.h:94,
from ../include/media_socket.h:9,
from ../include/call.h:26,
from ../include/redis.h:15,
from redis.c:1:
redis.c: In function 'redis_check_conn':
../lib/loglib.h:56:30: warning: format '%ld' expects argument of type 'long int', but argument 5 has type 'time_t' {aka 'long long int'} [-Wformat=]
56 | __ilog(prio, "[%s] " fmt, log_level_names[system], ##__VA_ARGS__); \
| ^~~~~~~
../lib/loglib.h:64:39: note: in expansion of macro 'ilogsn'
64 | #define ilogs(system, prio, fmt, ...) ilogsn(log_level_index_ ## system, prio, fmt, ##__VA_ARGS__)
| ^~~~~~
../lib/loglib.h:63:30: note: in expansion of macro 'ilogs'
63 | #define ilog(prio, fmt, ...) ilogs(core, prio, fmt, ##__VA_ARGS__)
| ^~~~~
redis.c:887:17: note: in expansion of macro 'ilog'
887 | ilog(LOG_WARNING, "Redis server %s is disabled. Don't try RE-Establishing for %ld more seconds",
| ^~~~
[1] https://sourceware.org/glibc/wiki/Y2038ProofnessDesign
[2] https://musl.libc.org/time64.html
Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
This makes it possible to add new streams without specifying the
direction/interface again.
Reported in #1366
Change-Id: I8f320ecbe72f123d755ba80370de9c40960eb0f0
If a keyspace notification SET is received and the call already exists
as a foreign call, the call is first destroyed before being re-restored.
The call destruction involves a DEL from Redis on the "hosted DB"
number, which points to the foreign DB. This makes it impossible to then
restore the call because it's just been deleted.
closes#1308closes#1334
Change-Id: Ie895b021441b2d299f8ebb5bde1824b01e12633c
commit d15fd4a547
Author: Damir Nedžibović <damir.nedzibovic@enreach.com>
Date: Tue Jul 6 14:07:42 2021 +0200
Also free the character data.
commit 8869187215
Author: Damir Nedžibović <damir.nedzibovic@enreach.com>
Date: Mon Jul 5 16:11:32 2021 +0200
Make documentation and parameters consistant.
commit 4b15aea2ee
Author: Damir Nedžibović <damir.nedzibovic@enreach.com>
Date: Thu Jun 10 15:34:00 2021 +0200
Update documentation.
commit 6ec1b3035d
Author: Damir Nedžibović <damir.nedzibovic@enreach.com>
Date: Thu Jun 10 15:33:12 2021 +0200
Do not use metadata for setting the recording file; use output_destination instead.
commit f65a76e8a3
Author: Damir Nedžibović <damir.nedzibovic@enreach.com>
Date: Wed Jun 9 15:56:02 2021 +0200
Only append file extension if skip_filename_extension is not set.
commit 92e9d7c679
Author: Damir Nedžibović <damir.nedzibovic@enreach.com>
Date: Wed Jun 9 14:12:48 2021 +0200
Rename the option to better match its usage.
commit 11128bff49
Author: Damir Nedžibović <damir.nedzibovic@enreach.com>
Date: Wed Jun 9 13:19:10 2021 +0200
Implement support for seting an output file and folder per recording.
Change-Id: I1579d62467eaf06a7aa1ac11e59dbb374f150deb
Complete overhaul of the codec handling code:
*) obsolete flags `asymmetric codecs`, `symmetric codecs`, `reorder
codecs`
*) support proper codec offer/answer
*) split codec manipulation (strip/offer/accept/etc) into separate
functions for clarity and better code maintenance
*) fully update codec handlers in both directions after an answer
*) explicit allocation and handling of codecs and payload types in a
codec_store object
*) improve codec matchup logic during answer
*) more explicit handling of supplemental codecs (CN/DTMF)
*) remove now obsolete hacks for handling certain use cases
Change-Id: I996705ba8fe339524c2f70e6bb0fd854f9a1f4fb
This solves problems when the same SSRC is looped through the same call
multiple times in different mono/dialogues, with different parameters.
Change-Id: I1d033cb1f012574d82b5bcbfffe11eb5f983cfd8