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
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
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
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
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
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
If both source and destination medias are non-RTP/non-SRTP,
then just consider it as pass through by default.
Change-Id: Id97a916ab236561e2ae776b54d89deae4da6f3ec
Add a function `sdp_out_original_media_attributes()`
which prints original attributes into the media, for
cases like MT_MESSAGE or ice force relay.
Change-Id: Ic5a3c1e4ed4a9ff3235fdf55252eba1e75c8381f
It's been noticed that trying to print a zero
conneciton address, on the media stream, which
actually offered non-zeroed IP source, but a
zero port, leads to a segmentation fault,
because it relies in this case on presented
`sockaddr_t` information, which is actually absent.
This happens only with sdp_create on offer/answer.
Test fixed is "a=mid on zero streams".
Change-Id: Ic2f7f671c9ded9b361d6467ca013698fdff28538
Look for the first usable (non-rejected, non-empty)
media and ps, thereby to determine session-level attributes,
if any. For that to work, it has to have `->selected_sfd`
of the packet stream.
Change-Id: Id4324864571bc78936aa16e235e3866e40860420
Remove print_sdp_media_section's dependency on sdp_media and instead use
a call_media object as source.
Change-Id: I0486b10590ae996da22822f57ec48110f4b88da1
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
Refactor the `sdp_out_add_other()` function to be compatible
with the sdp attribute manipulations.
Change-Id: I134b58c5126ff34804ebf9458faf8509250e097a