Don't proceed with the trickle updates in
case the required room, hence a call
hasn't been found.
Fixes Coverity Scan defect:
*** CID 1600057: Null pointer dereferences (NULL_RETURNS)
/daemon/janus.c: 1679 in janus_trickle()
1673 // ufrag can be given in-line or separately
1674 sp->ice_ufrag = cand->ufrag;
1675 if (!sp->ice_ufrag.len && ufrag)
1676 bencode_strdup_str(&ngbuf->buffer, &sp->ice_ufrag, ufrag);
1677
1678 // finally do the update
>>> CID 1600057: Null pointer dereferences (NULL_RETURNS)
>>> Dereferencing a pointer that might be "NULL" "call" when calling "trickle_ice_update".
1679 trickle_ice_update(ngbuf, call, &flags, &streams);
1680
1681 return NULL;
1682 }
1683
1684
Change-Id: Ib2e293c2f99e914e3d02fe43d08160ec30892ae4
0f9dd5def2 introduced this check for `source_media`
which was only in use by `sdp_replace()` functionality.
`sdp_create()`'s one never really reaches it, even
in older implementation where `handle_sdp_media_attributes()`
was used.
So for now it has no use, just remove it.
Fixes:
*** CID 1600058: Control flow issues (DEADCODE)
/daemon/sdp.c: 2690 in print_sdp_media_section()
2684
2685 /* print sendrecv */
2686 if (!flags->original_sendrecv)
2687 append_attr_to_gstring(s, sdp_get_sendrecv(media), NULL, flags,
2688 media->type_id);
2689 else if (source_media)
>>> CID 1600058: Control flow issues (DEADCODE)
>>> Execution cannot reach this statement: "append_attr_to_gstring(s, s...".
2690 append_attr_to_gstring(s, sdp_get_sendrecv(source_media), NULL, flags,
2691 media->type_id);
2692
2693 ps_rtcp = print_rtcp(s, media, rtp_ps_link, flags);
2694
2695 if (proto_is_rtp(media->protocol)) {
** CID 1600057: Null pointer dereferences (NULL_RETURNS)
Change-Id: I2d2ffbb0c9ecc0fae8890367754fbbd6e79e9c21
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
Avoids allocating and duplicating the string. Should be safe as all
strings that use it are allocated in read-write memory.
Requires changing some struct members to non-const.
Change-Id: Idc81a84a1454898c76d8514666c385307043bb6f
If a string is already stored within the call's memory arena, skip
duplicating the string content when making a copy, and simply return the
same pointer.
Change-Id: I50107d87b2625234a395da21e1e4551585966a60
Use provided macros for initrialise str objects everywhere instead of
manually setting .s and .len. This allows for flexibility to extend str
objects.
Change-Id: I5ebca0bc82b348301c2c8e94b974c7acbf249b82
Convenience wrapper for &STR()
This is useful so that STR() and STR_DUP() can be extended to avoid
duplicate expansion of its macro arguments.
Change-Id: Ieae170807c11b0cdd8b52fac9bab98dccdc2b951
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
If we remove a session that is not the session we're looking for
(re-used session ID after a removal race), we must return the incorrect
session to the hash table.
Change-Id: Iab73e1994251e5be766406b4e537a954b0e81f07
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
The OTHER type attributes are not used outside of sdp.c. Move the
definitions into the appropriate scope.
Rename fields to be consistent with other attributes.
No-op.
Change-Id: Id92f2df2f475db92ee5ae1f3474191266d6d196d
Use a BIO WRITE callback instead of BIO_read'ing from the BIO after each
operation. This is a more direct way to intercept data that needs to be
sent out.
Implement MTU-related BIO callbacks.
Deduct the assumed IP MTU overhead from the configured MTU during
startup.
Unlike the previous code, this does not necessarily send DTLS from the
same socket that received a message, nor to the same address that sent
one, and instead always uses the selected_sfd and ->endpoint. This may
or may not be a regression.
Closes#1806
Change-Id: I4d4456df3f378d00782cbfa64afdb2a038217e6c
Refactor inactive streams handling (non-accepted media) so,
that they get also labels being printed.
Change-Id: I6627aba77a5f391f797762202eb4f0977bc0fc4a
Just remove them and re-write commentaries so,
that they make sense taking into account we don't use
the chopper anymore.
Change-Id: I60254061d6d2a7c7b1b181c288144e27b8d2c6b5
Because currently it is directly handled by the
`generic_append_attr_to_gstring()` implementation, a couple
of functions (previously used by the sdp_replace)
are from now on obsolete and not needed anymore:
- `sdp_manipulations_subst_attr()`
- `sdp_manipulate_remove_attr()`
Just remove them.
Change-Id: Ia33218fa4c144812ff3265abafb62fd7f50f6955
Instead of returning a pointer to ps, just return void,
because previously used pointer (by sdp_replace) is
not used by any other function.
Change-Id: If2e211b98ab801061f40210b571804ff8184124f
Move content of the `handle_sdp_media_attributes()` function
into the `print_sdp_media_section()` function. With all required
refactoring. No functional change.
Change-Id: Ia1e5019165a4ea281f17ac8df712701eea772155
From now on inactive medias are handled in advance
by `handle_sdp_media_attributes()`, so all non-accepted medias
are alsways caught here and never deal with
`print_sdp_media_section()`.
Hence, deprecate `is_active` bool for it and refactor the
implementation of `print_sdp_media_section()`.
Change-Id: Ief7b1de204681373660c74c71c972b289216015c
Due to deprecation of the sdp_replace
approach just rework the `sdp_version_check()`
functionality as well as the `sdp_version_replace()` so,
that it complies with current state of things.
Chopper processing is not honored anymore.
Sessions parameter has been obsoleted, hence removed.
Change-Id: I4cee1e63c70e5ff5c3694d185a1bb841b5e6fa3a
Due to no usage just discontinue the following
functionality:
- `process_session_attributes()`
- `process_media_attributes()`
Change-Id: Ie1742aaa0155e27f94c72464d527c14c4cf03ee8
Discontinue `replace_sdp_media_section()` used before
to replace media sessions, also deprecate all subsequent
functionality:
- replace_network_address()
- synth_session_connection()
- replace_media_type()
- replace_media_port()
- replace_consecutive_port_count()
- replace_transport_protocol()
- replace_codec_list()
Change-Id: I0a455f6d105fa0a2ea61461ee92944ec990240ef
Move the SDP offer/answer model to the sdp_create
approach instead of using the sdp_replace one.
This assumes the SDP body including session level
attributes (s=, o=, t= etc.), as well as the media
attributes, are formatted using currently given
session context.
In other words, rtpengine collects all possible
information during all of the offer/answer exchanges
within the dialog, which in its turn affects each
monologue's context, from which each new SDP message
will be built up.
This approach replaces the older one, which instead
used to go through the currenty processed SDP and
just replace those attributes, that rtpengine
is required to affect, leaving the rest untouched.
Additionally: all of the existing offer/asnwer model
tests were fixed to comply with the currect change.
Most of it is just an offset of attributes, which are
stored a bit higher/lower within the same media or global
SDP session.
Also a good part of unit test fixes targets a move of
`c=` line from the session level to the media one (so
each media has from now on its own `c=` attribute). This
does discontinue a support for session level connection
information.
Change-Id: Iecb4739683d23c4f9341e8a34b71f8ca2070956c
For the sdp_create approach, currently given monologue
is actually the holder of `session_last_sdp_orig` for
currently processed direction of SDP preparation.
So this -> other, whereas other keeps the required last orig.
Change-Id: Id1bdb80ecc0401be5fd430cd4369b8588de4379b
Move the `sdp_manipulations_add()` func to work with
Gstring directly, instead of using the chopper object.
This will be needed later, when working with it
from behalf of sdp_create.
Change-Id: I2843aa0c97cb968adb450ca985efa6d7d9b2275e
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
Because not specificially used in rtpengine,
just deprecate it. Not to be mixed with
the `label=xxx` usage via NG protocol.
This will be also required when switching to
the sdp create approach, because needs to be
delivered via generics to print out SDP.
No functional change. Tests had to be fixed accordingly,
because of the appeared offset in the list of attributes.
Additionally, tests containing coming SDP with a label,
but which are within inactive media, don't pass it further.
One single example of it is an answer case of "a=mid mixup" test.
This is because of `print_sdp_media_section()` specifics,
and only printing generics for active media sessions.
Change-Id: Iabb44adf17adb5d8e0c5bcad20f527b591b2222c
Add rtcp-fb attributes applied to all payload types
via generic attributes instead of using the chopper.
This will be required when switching to the sdp create
approach.
No functional change. Tests containing `*` payload type
had to be fixed accordingly, because of the appeared
offset in the list of attributes.
Change-Id: I9fc1d2faf578a3c533cd85e5e52afd4af2062149