Media IDs are supposed to be unique. Non-RFC OSRTP may however lead to
duplicated media sections with the same media ID. Use a hash table to
track which media IDs have already been seen, and ignore any duplicates.
Change-Id: I9de5fdf3165fc4326862af708aec3d4f6736cb12
(cherry picked from commit b742dbc460)
(cherry picked from commit 87f5434415)
This is a normal condition for a first offer. Reduce log level to debug.
NGCP-Flow: mr13.1
Change-Id: I785cee82ead90b1e797c09017c3e3a77da113553
(cherry picked from commit d483ef185bb846a9695584944233f61546fdb0f7)
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)
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)
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)
There is enough overlap between the two enums that it doesn't make sense
to carry along both. Unify.
Change-Id: I9de8fbdb8d78a2002d8c1b62cea57188c937d61d
Allow to-tag updates in answers only until a non-provisional response is
received. Add a flag to optionally suppress this feature.
Change-Id: I67110ede662f618ba5a355500d3d84050e6318cc
If we receive an answer from a to-tag that hasn't previously seen and no
corresponding monologue exists (created from a previous offer),
previously we would treat this is a separate and new call branch, create
a brand new monologue and dissociate the previous one. This may lead to
unexpected results as this new monologue has been created without the
same initialisation as was done for the original one, and so may be left
with incorrect or incomplete data (e.g. SRTP keys, codec information,
interface bindings, etc).
Improve this by treating an unexpected and unseen to-tag as an alias to
the already existing to-tag. Going forward both tags can be used
interchangeably to refer to the same monologue.
Add a flag to suppress this new behaviour, in case some situation is
made worse by it.
Change-Id: Ie8f838eebd50d29d3549031998a2eb1f610b04bb
Refactor media level manipulations, no funcitonal change.
Just add a separate static function that does
all the job to create fictitious (zeroed) media.
Change-Id: Ifa39e31cdeaa093710cf8b834e7e08881056212f
In order to be able to control, which media types
one wants to have in the call session,
add support of the "sdp-media-remove" flag.
Syntax:
"sdp-media-remove" : ["<media-type>", "<media-type>", ...]
Additionally, add according unit tests.
Change-Id: Ic52456f8124319992ea9ca8c161daefb1df46b59
During the monologues lookup in
`call_get_dialogue()`,
instead of relying on the very first available
other side subscription, when doing a lookup
of this side, try to look into all of them
to find available media with existing subs.
Change-Id: If232cd25f26a2bc56eb1f401ba5c2c8a13e3e463
While handling offer/answer exchanges, do:
- index based lookup for sender's side (both offers and answers)
- index based lookup for receiver's side, but for offer only
- subscription based lookup for receiver's side, but for answer
Additionally: fix "media playback after delete" test,
because each new offer/answer exchange towards new branch,
means to have new via-branch value.
Change-Id: I078b7f7e58fa1aafbd8e68662f5f14ecb15b53c0
Don't unsubscribe offer from its existing
subscriptions, because it may have multiple
branched receiver's monologues, and hence medias.
Change-Id: I5caf515f35688041b684fbea9bf05ae559d43e15
When calling `__subscribe_medias_both_ways()`,
add sender to receiver, and not the other way.
This is just for simplicity of code reading
(so kinda: from -> to).
Change-Id: I7df889b7744c1fc3c1bec5016adbe6924e5396c3
If a monologue is determined to get a new to-tag, don't just overwrite
the previous to-tag, but also save the old one as an alias. Leave the
old one in the hash table as well so that future lookups can use either
to-tag.
Change-Id: I5d2d5cc17c85ec4ca2d8a20c501d2cdb6d793b61
The `if` block ends with a goto, so the indent for the `else` block is
not needed. Remove it for readability.
Change-Id: I0ab88246cfebf105c2256d129890925706917618
Add a getter function for retrieval of top
most media from given media.
Currently existing getter for the top most
monologue's media subscription, just rename
so it makes more sense and is better to
differentiate:
`call_get_top_media_subscription()` -> `call_ml_get_top_ms()`
Change-Id: I5bf13b69b4d5f67cd6b53018b5a16d759542cd41
Always create the offer/answer subscriptions during an offer/answer
exchange, making sure that no other offer/answer subscriptions can
exist.
Change-Id: I95e584c24e7ba74f2ead36d0c23976ef1f2e461c
Make sure stats are always added to the `delete` message.
Fixes stats being missing in case of `delete` without from-tag.
Change-Id: I635cc87b91d3e488696f33380b12dc68a24e51ad
Not needed any more. All strings reside in the call's memory arena, and
SDP rewriting isn't a thing any more.
Change-Id: I594b85fe26f44fa25312eb97fb65de238fc18920
Instead of keeping one global hash/list of all received ICE fragments,
indexed by string call ID and from-tag, move the hash/list of ICE
fragments into the call object, now indxed only by the from-tag.
This requires a call object to exist before an ICE fragment can be
stored. Change the order of operations to always create a call object
first, then parse the SDP, then check for ICE fragment processing. The
determining factor now is only whether the monologue exists.
Duplicate the raw SDP into the call's memory arena instead of onto the
heap.
ICE fragments now don't need to store the pre-parsed SDP any more, and
the trickle ICE handling code is guaranteed to always have the fully
parsed SDP information.
Strings for fragment indexes can now be allocated from the call's memory
arena.
Obsolete the extra thread used to delete old ICE fragments. This is now
done in-line with regular call timeout processing.
Change-Id: I7acbc4c52666c4cdf1c02324bf33cf0bfcb4f0d0
Flag the media via stream params, when it's
trickle or non-trickle offer/answer, and,
unflag it always only when it's non-trickle.
Change-Id: Ia85ce5792684a4121e224aff1a8e941e061fe5a8
When processing bandwidth attributes per session
level, always update them, independently if the
currently parsed value has been set => 0.
The problem is, that if we only set them,
when initialized to != -1, then every new offer
within existing dialog, will keep bandwidth set
for the monologue, even if the newer offer
doesn't set this anymore.
Change-Id: Ifef964798a8ce9b38a4fd5f26b5bb4d0678b8829
The `med` is assigned to NULL, which however
doesn't serve any purpose. To fix this defect report,
just remove the redundant assignment.
Fixes the:
*** CID 1600020: Code maintainability issues (UNUSED_VALUE)
/daemon/call.c: 690 in __get_media()
684 med = g_hash_table_lookup(ml->media_ids, &sp->media_id);
685 if (med) {
686 if (med->type_id == sp->type_id)
687 return med;
688 ilogs(ice, LOG_WARN, "Ignoring media ID '" STR_FORMAT "' as media type doesn't match. "
689 "Was media ID changed?", STR_FMT(&sp->media_id));
>>> CID 1600020: Code maintainability issues (UNUSED_VALUE)
>>> Assigning value "NULL" to "med" here, but that stored value is overwritten before it can be used.
690 med = NULL;
691 }
692 if (flags->trickle_ice)
693 ilogs(ice, LOG_ERR, "Received trickle ICE SDP fragment with unknown media ID '"
694 STR_FORMAT "'",
695 STR_FMT(&sp->media_id));
Change-Id: I9871be9cab8928a8e5b6ad2a5e403b9ee3d44295
Instead of having to explicitly pass the call object to each invocation,
keep one thread-local reference to a call, implicitly set by setting the
logging context.
Add helper functions to set and release the respective reference.
Change-Id: Ic0d82eeaa403467d50dae867e33fdf9b9dd7cec5