If the receiver of a previously passthrough T.30 stream gets switched to
a generated PCM stream from a T.38 gateway, continue the sequencing of
the previous SSRC. Technically this is not necessary as the generated
PCM stream gets a new SSRC, but at least Asterisk seems to ignore this
and expect sequencing to continue, and will ignore PCM if the sequence
jump is too large.
Change-Id: Ia4656770db11f5fa1a1e9bf5bd71a0398deb1e00
(cherry picked from commit 18579227a9)
A call that gets created but then doesn't get initialised would have its
Redis DB left at zero. At destruction it would then try to switch to DB
zero. Fix this by using an appropriate initial value.
Closes#1905
Change-Id: I852e48c5a06b732b37d2ccd5c478de4760aacd4e
(cherry picked from commit add46f265a)
Fixes a corner case that happens when trying to delete a call created with
ng offer and no-redis-update flag and for which no ng answer was received.
In such cases, one would receive warning messages from Redis
"ERR DB index is out of range".
What happens is that on call creation redis_hosted_db defaults to -1. This
value is changed when writing to Redis, but the writing is not done for a
ng offer with no-redis-update.
Kudos go to Pawel Kuzak.
Closes#1910
Change-Id: Iad19ec8ac69b169e6352662697b17eb23e6970fb
(cherry picked from commit bba9625b25)
The `if` block ends with a goto, so the indent for the `else` block is
not needed. Remove it for readability.
Change-Id: I0ab88246cfebf105c2256d129890925706917618
(cherry picked from commit a6775d3ca7)
Make sure stats are always added to the `delete` message.
Fixes stats being missing in case of `delete` without from-tag.
Change-Id: I635cc87b91d3e488696f33380b12dc68a24e51ad
(cherry picked from commit 7b28ec4402)
If media type doesn't match, assume a change in a=mid and ignore it.
Change-Id: Id0c8d7b9163445266e4179f4388109954226c4fa
(cherry picked from commit 2aa11c2a2a)
The subscriptions must be removed first and the update function must be
called second. Otherwise unsubscribe doesn't have any immediate effect.
Closes#1851
Change-Id: Iccc449357f7136b863ba2d633b24942dbe87d767
(cherry picked from commit 2d18d6189b)
While processing subscriptions in `monologue_subscribe_request()`
update the `->session_last_sdp_orig` related to the dest monologue.
This can be then later used in the `sdp_create()` the user
of which is `call_subscribe_request_ng()`.
Change-Id: Iee503ca94f82e0e5334fcd787f984f1ed3f7ca4d
Set the `monologue->session_last_sdp_orig` not while
replacing in `sdp_replace()`, but while initializing the
monologue in `__call_monologue_init_from_flags()`.
This allows to be agnostic in relation to `sdp_replace()`,
and let the `monologue->session_last_sdp_orig` be always
actual for the `sdp_create()` related processing
(without a need to pull the SDP sessions list towards it).
Change-Id: Ideb129ab8a94ef750abfa222335aede42bcbcc89
Instead of using separate char arrays storing
parts of the SDP origin (in monologue), just
use the corresponding structure.
Deprecate unused parts used before.
Additionally add logic:
don't set `->session_sdp_orig` for monologues
with empty tags. This leads to setting origin line
to those monologues, which will later skip updating it
with its own (so real one).
This is fixes the case with the offer/answer model,
where offer always sets its origin for the other side,
meanwhile the other side hasn't given the answer yet.
Then later this answer related monologue never gets
its real origin.
For this sake also adopt logic of `sdp_version_check()`
which serves 'SDP-version' and 'force-increment-sdp-ver'
flags.
Change-Id: I17f3ff67e1b3dafca797c5feb876ebb238dceaa2
Instead of using separate data members to
bring data with the `call_monologue` structure,
just use the whole `sdp_origin` object type (structure)
as a pointer and keep it aling with real SDP origin
of according monologue's side.
Refactor the code accordingly for `sdp_create()`
users (firstly only here).
Additionally introduce functions to alloc/de-alloc
`sdp_orig` object:
- `sdp_orig_dup()` returns a pointer to copied object
- `sdp_orig_free()` deallocates it
Change-Id: Iff6a777e4867e78c73ca79c73fdb73ff8e9f22eb
If already included by the main header (call.h)
then don't do that second time in the implementation (call.c).
Change-Id: I2cabf48cbd3bca00efc68c76b54c582223a10efc
Move the `call_subscribe_request_ng()` fully to a usage
of the `sdp_create()` only.
Carry the origin IP and net family via flags
to the monologue, so can be reused later when creating SDP.
Always use given SDP session origin IP address and family
for the SDP being prepared, unless sdp origin replacement
is required via given flags (in this case just used
an advertised IP of rtpengine).
Additionally: fix unit tests for subscribe cases accordingly
to the policy.
Change-Id: Ib7697876ce45e01597edd27764d4147d12f738c8
Run the SDES reordering routine also when the opposite side is plain
RTP. Add a matching test case.
Ref: https://groups.google.com/g/rtpengine/c/pG6NB24G-BY
Change-Id: I7844290e85e44c1bba2c7665202b6259aead1028
Split the code that handles reordering offerer SDES suites based on the
respective option into its own function. Rework it slightly so that it
reorders the list in place for simplicity. Remove the part that honours
SDES-no and SDES-only as these should affect the opposite (outgoing)
direction. This requires changing one of the test cases, which seems
more correct now.
Change-Id: Ie284d052d72031fad64c94767fa95c74639ae331
Update the bandwidth in the media object only on the side that has
received the SDP. Then when printing the SDP, look up the peer's media
via the subscriptions and use that one's bandwidth values.
Change-Id: I53c99b3628f53b2469f4cd73eb486c0110d989ba
Instead of carrying along an extra entry for the remote address, use the
existing advertised_endpoint, and look up the appropriate peer via media
subscriptions when printing the SDP.
Change-Id: I4c79053ba0fe072562ad71eb62ece3c527008936
Don't carry parameters required for processing
in the `sdp_create()` via the `stream_params`,
but rahter handle them like:
- parsing in `sdp_parse()`
- `sdp_media` -> `stream_params` in sdp_streams()
- `stream_params` -> `call_media` in ` __media_init_from_flags()`
Additionally: update the test "subscribe_request AMR asymmetric".
This is because we seem to never actually take into account
presence of bandwidth data in offer/answer model preceding
the subscribe request.
Change-Id: I5b4b19ae244c6bbf961d5ea7c18b6747519144db
Always ensure to set the actual sdp session timing
if given, when creating SDP using `sdp_create()`.
Otherwise just use default value "0 0".
A new dedicated func `sdp_out_add_timing()` introduced
for that.
Change-Id: Ic02e1a1f55e21b85e50793e1608978ca0951c49d
Always ensure to set the actual sdp session level
bandwidth, if given, when creating SDP using `sdp_create()`.
A new dedicated func `sdp_out_add_bandwidth()` introduced
for that.
Additionally: explicitely set b=RR/b=RS to -1 when creating
a brand new monologue (e.g. for subscriber requests case)
so it's not considered as 0 inadvertently.
Change-Id: I5bfa236ceeb326785feadadf7f22393814505d3f
For typed hash tables, enforce the correct type in the arguments to the
hashing and equality functions.
Adapt existing affected callback functions and change their arguments
from void* to the respective types.
Add reverse casts to GHashFunc and GEqualFunc in instances where these
functions are used in non-typed hash tables (that should be converted at
a later point).
Add convenience macro to create typed wrapper functions for hash tables
that use "direct" hashing (i.e. the pointer value).
Add wrappers for existing GLib functions that have generic arguments so
that they can be used in typed hash tables.
Change-Id: I43bb32969208f4aae49584d95c0df8353df6e2a0
Always ensure to set the actual sdp session name when
creating SDP using `sdp_create()`.
A new dedicated func `sdp_out_add_session_name()` introduced
for that.
Additionally: fix auto-daemon-tests-websocket and
auto-daemon-tests-pubsub accordingly.
Change-Id: Ie62573149ef9ae226dc8c955dcb2cfaaa4d3ae87
In order to be able to retrieve the top most media
subscription of top media for a given call monologue, introduce
a new func: `call_get_top_media_subscription()`
This is then useful for offer/answer model cases,
where most of cases single-to-single subscription model is used,
and one needs just an access to the opposite subscription/monologue/etc.
Change-Id: I6139a0987eda618d0d27b173abdce6c7562e0544
In order to be able to set `sdp_origin` related things
while initiating a monologue from flags (so in
`__call_monologue_init_from_flags()` ), duplicate `sdp_origin`
from `sdp_session` while doing streams parsing in `sdp_streams()`.
Change-Id: I17a4400a41623d336590010e9dfc5389460b27be
Use relaxed-order atomic ops to access config variables that can be set
during run time.
Rename config_lock to keyspaces_lock as the keyspaces list remains the
only object that it protects.
All other config variables aren't settable at runtime and so don't
require locks or atomic ops.
Change-Id: I7e01a34a4818a558d5648ae27a86f9880a95d050
The requirement to continuously update stats from the kernel has been
eliminates. Remove all relevant code.
Change-Id: Idc8093b64290b89ff3d015f3e61e4bbe25df6e23
We now have accurate "last packet" timestamps for both user and kernel
space. Since we iterate all calls anyway, we can use these timestamps to
update the gauges.
Change-Id: If0522c387ed1fba51058129ef37a41f45d0c0c8b
Use the already existing ext_seq (in shm) in place of srtp_index as
these carry duplicate information.
Kernel still tracks its own index in the crypto context at this point.
Change data type from 64-bit to (unsigned) int as we don't need that
many bits.
Change-Id: I2468c6a814964eb64a19d84c918d3a37c2494b66
Keep two separate timestamps, one updated by userspace code only and the
other updated by kernel only. This way we can tell where the packet
processing happens. For code that wants to report only the last
timestamp regardless of which one of the two it is, we add a convenience
function that just returns the newer one.
Change-Id: Ib3af7aa55006d8b32e2bc3db4f8bfa5514c57e40
Allocate memory from bufferpool for per-stream stats. No functional
change, but it allows sharing these between kernel and user space.
Change-Id: I370a49e1d94bb91c7fd0a2bc7d00ba65f99c4f6a
This has been broken for a while and nobody seems to be using it since
nobody complained. Remove it.
Change-Id: I114e7b1859ecd1982338c625f4523f372af3bbe8