Mark those SDPs which trigger processing
of music-on-hold.
Is defined by the config option:
`moh-attr-name`. If not defined then
is not used.
Will be useful for cases when it's important
for remote components to detect ongoing hold.
Change-Id: I0f2a284955dbc045b51920174f1f4fbefcb93907
Use an object with local storage for sdp_address instead of just setting
a pointer. This makes it possible to put a different address.
Change-Id: I92e69b6a9eba9d0caa3853b3dcb134951d76b145
There is enough overlap between the two enums that it doesn't make sense
to carry along both. Unify.
Change-Id: I9de8fbdb8d78a2002d8c1b62cea57188c937d61d
Don't add session level bandwidth for subscribe requests,
because it's anyway mixing different medias from all parties
in one SDP and cannot really apply session level (so global)
bandwidth taken from one of the medias, to all medias.
Change-Id: If8fb5358cdae897ca811a3bd565d8be055e2101e
Re-move misleading log line to another place.
In the `sdp_manipulate_remove()` function:
- true - means remove
- false - means don't remove
Correct logging accordingly.
Change-Id: I3e0c08552a0192f3985da990b5f0c96cc31ece94
Convert existing sdp manipulation helpers
to work with arrays directly, independently from
which array is actually given.
Moreover, don't use the `G_N_ELEMENTS()`,
since we already have the `__MT_MAX`
as the size of the array, so we can directly use
that instead of relying on the G_N_ELEMENTS macro
(for array size checks).
Change-Id: I38e71dab30a467b933c213c8157fa06651ebaf04
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
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