Add a function to handle other non specific attributes
for the session level.
E.g.: ice-lite or anti-looper (rtpengine).
Change-Id: I147403ff9e3c3ff8be6718b8b118e405442a9220
In case when the `packet_stream`, selected via the
media being iterated, has no `->selected_sfd`,
just set the port value to 0.
Also skip adding any further attributes, like
connection information or any other, since
this media by fact is not accepted.
This is a usecase for OSRTP related scenarios,
where RTP media session can have 0 port set.
Change-Id: I7784b80e7d51d19106ea30db585143375a5ba050
Move printing of attributes to a separate func,
in order to be able to re-use this print during
the same media section iteration (e.g. with OSRTP).
Later on this func is to be merged with the
`print_sdp_media_section()` function, after
the sdp_replace is fully deprecated.
Change-Id: I15825ed6eecb450b742b31677961fd8ddbf950fb
Added support of the AS bandwidth attribute for the
SDP session level. Will be required later for the SDP
formatting in `sdp_create()`.
Change-Id: I1bde4659679de6e60bdad12c0578ced2c1983300
Same as ptime but for the maxptime.
Also add replication of it.
This is required later to be used for the sdp_create() handling.
Additionally: fix tests, because maxptime now takes another
place within the media session, which doesn't affect functionality.
Change-Id: I058e35323849679976c60b2e9fb2555fd0168e67
Already checked before in sdp_version_check.
Fixes defect:
/daemon/sdp.c: 2936 in sdp_version_replace()
2930 /* update string unconditionally to keep position tracking intact */
2931 chopper_replace(chop, &origin->version_str, &origin->version_output_pos, version_str, version_len);
2932 }
2933 }
2934 /* for sdp_create */
2935 else {
>>> CID 1598877: Null pointer dereferences (REVERSE_INULL)
>>> Null-checking "src_orig" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
2936 if (!other_orig || !src_orig)
2937 return;
2938
2939 other_orig->version_num = src_orig->version_num;
2940 /* is our new value longer? */
2941 if (version_len > other_orig->version_str.len) {
Change-Id: I068a13ccc454fd61600546d05c78bde979203fc7
Don't treat the `force_inc_sdp_ver` flag as
the `replace_sdp_version` one, but consider
it as a separate option flag.
Correct usage of it accordingly.
Additionally: change sdp_version_check() func signature
to use `force_increase` as bool.
Change-Id: I9ed772a5a3535d887dda5a5a116b6326c8f5f46a
Obsolete str_init(), rename STR_INIT() to just STR(), and replace all
instances of str_init() with STR().
no-op
Change-Id: I981529063ad2ea26089add467f7a84b638dbf423
These helper functions were largely unused or inconsistently used.
Create a new type and streamline usage.
Change-Id: I5cd9756a26994d027dd4ff6a2d01a8c6c3cffe30
Add support of replacements flags:
- replace-origin
- replace-origin-username
- replace-origin-full
Additionally: fix websocket tests, because now
the `-` symbol isn't considered as the one to be
set always when using `replce-origin-full`.
Instead it will use values of the very first parsed SDP.
Change-Id: I7636f020cb92cb760fcd25b0b84509e6d5ba2a9f
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
The option flag `replace-origin-full` should replace whole
origin (o=) line of the SDP body, so that all origin fields
in the `o=` line always remain the same in all SDPs going to a
particular RTP endpoint.
So, not just a straight-forward replacing with own values.
A behavior in relation to the address field is the same
as by the `origin` option flag.
Correct according tests and add one more.
Change-Id: I4bcb740db5cd68a75fb754f5f6b5d21e19b05e1b
Use the `->session_last_sdp_orig` for the version as well as
username type of replacements.
Remove superfluous code.
It's possible to handle it like that, because the last user
of the sdp_replace func, which is the offer/answer model, sets
the `->session_sdp_orig` actually in `__call_monologue_init_from_flags`.
Additionally: add tests for the user type of the origin replacement.
Change-Id: Idd60e628c676840c2e844077303035c0edec67e2
Make the `sdp_replace()` compliant with `sdp_create()` in terms
of the replace `origin-full` flag support.
Also introduce according unit tests.
Change-Id: Ib950a957d5ee3820dbc8a831fe0a7ea570b4c59b
Two version of the origin replace exist from now on:
- `origin-replace` - replaces only the origin address
- `origin-replace-full` - replaces all the values,
so name, id, version and IP family with address.
Values for replacing are taken from the rtpengine instance,
so local values provided by the daemon.
Additionally: documentation updated accordingly.
Additionally: revert changes in pub-sub test.
Change-Id: I4d068944726d1ab82683ca5aa641a954890aefcf
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
For the sake of simplicity in usage and also
visibility for rest of file implementers
via the types.h, turn `strct sdp_origin` into
the typedef `sdp_origin`.
Change-Id: I13e71b9bbc944cf2931afc4fbc2c3f465eea815c
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
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
Set real values instead of just: -1, 0 or 1.
This affects: AS (per media) and RR, RS (per media/sdp session).
Change-Id: I9cf565548726c96c2ce74c86c1cbfe7920d8d943
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 media session level
bandwidth, if given, when creating SDP using `sdp_create()`:
- AS
- RR
- RS
All of them can be presented simultaneously.
Adjust existing function `sdp_out_add_bandwidth()` to comply
with media session level demands.
Change-Id: I9599df051109ec05c4549ae79fae906fb5980dad
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
As the standard assumes, that the bandwidth
can be also controlled per media, it makes
sense to support it, so introduce `b=AS:` attr
parsing.
Change-Id: Id4b344c10bbd45b1f3ba14a882d58072a4e43c68
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
In all the cases (apart PUBLISH) ensure to set the actual
media connection when creating SDP using `sdp_create()`.
A new dedicated func `sdp_out_add_media_connection()`
introduced for that.
Change-Id: I26e9b123aad95e2d335aef903d441ecc2cae2605
To prepare the deprecation of session level connection
usage (so the `c=` attribute of the session level),
deprecate first the `replace-session-connection` flag
support, because it will have essentially no use.
Change-Id: I9f9cb8f06d03d1c107a5c928054a79409642bb5b
Rework the `sdp_out_add_origin()` func so, that
it's compatible with offer/answer model.
Additionally it uses the previously existing logic
for the PUBLISH operations always, regardless any
conditions.
Additionally: fix auto-daemon-tests-websocket accordingly.
Change-Id: I0bddc67f4ebe47a24063ccc82428929aeb6cc37a
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
Always ensure to set the origin name properly when
creating SDP using `sdp_create()`.
A new dedicated func `sdp_out_add_oirigin()` introduced
for that.
Additionally: fix auto-daemon-tests-websocket accordingly.
Change-Id: I671f7b54f8bed9c4b78d6532c0072836d77173e6
In order to be able to use similar attributes manipulations
as in the `sdp_replace()` (based on the `sdp_ng_flags`)
a non-const parameter is required.
Change-Id: I4dce1edfa16b0c2dcd9315a2a3d8cc585f32858f
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
Synchronize the `enum call_opmode` with the
kamailio module list of operation modes, as well
as with the `enum ng_command`.
This allows to operate based on `call_opmode`
in a more specific way, for example for a proper
setting of From/To tags based on directional flag,
which in its turn is being set using `call_opmode`.
Additionally introduce a macro checker, which covers
all previously non-existent operation mode types
as OP_OTHER, for backwards compatibility in conditions.
Change-Id: Idf4b9d910b81ee24be51008996c3fd02d8336a38
Store SDP session attributes in the monologue that were received instead
of the ones to be sent out. Look up the corresponding source monologue
when creating an outgoing SDP and insert that one's attributes.
Change-Id: Ic2e57db71b0e0b48b9868940d326b5a951d89e92
Consider call_media SDP attributes as ones that were received instead of
the ones to be sent out. Use media subscriptions to look up the source
media and print that one's attributes when creating an outgoing SDP.
Change-Id: Ibdf3a77a6f8a61654e0fc7c14aae16dfc6eabf14
Make 'extmap' attributes another type of OTHER attribute, which are
printed verbatim, but instead of skipping over them when parsing them
and "strip extmap" is requested, always parse and store them and then
skip over them when printing them.
Change-Id: I9f8e9c468ea0d1b20d82ae563c334513a8c0c43e
All OTHER attributes are printed verbatim as strings, but we still want
to be able to distinguish between different types of them. Introduce an
extra enum for that purpose.
Change-Id: I24351c26a45ffbbe1dec9299faa5d0ea65cada29
Even though both true and false are set in different calls to the
function, there's no effective difference in output.
Change-Id: I0d29dbf2d8041523b6b28bb0c0270bb6b414dcb5
Make sure sdp_attributes is only used for _received_ SDP attributes, and
not ones that we want to send out. The only places where self-generated
attributes are being used is the T.38 gateway.
Change-Id: I1f035cd42a35fa250ea477700a1a88ad59efcc38
Use a settable callback function to do attribute printing. This makes it
possible to use different sources for SDP attribute output in different
situations.
Change-Id: I30be7772dd73d9ca8cb9483de53eb60734e12950
Create a separate smaller struct that contains only the relevant pieces
of the attribute string. Embed this into the larger `sdp_attribute`
struct, which also contains all the parsed-out information, which is
needed only during initial processing.
Functional no-op.
Change-Id: I5a70f8b7c9922c312aa03782f85e7db40f054092
Fix up tests to match reordered attributes.
Remove 10-year-old a=ssrc parsing code completely as it's unused.
Change-Id: I78064b1b2f27a442fe8bf4b448c7174c5458d3b1
For tagged attributes using a `a=name:tag value` format, extend pattern
matching so that just `name` matches as well as `name:tag`. Only support
this for removal (not substitution) as these attributes generally can
appear multiple times, and doing a static substitution on all of them is
kinda pointless.
Change-Id: I07c7f6e9075e862902bffe679d5de8618162eb8f
As we don't directly append to an existing GString any more anyway,
simplify the function signature by just returning a new GString if the
format string is known.
Change-Id: I9f8e6fbd93ea063eecb519cd57366effd4022f75
For attributes that have a value, consider both the full attribute
string `a=name:value` and just the attribute name itself `a=name` when
checking for removal and substitution instructions.
Change-Id: Ia648a4db8c80a5c23abf44f75b45e29acdf1b91d
With attributes names separated from their values, we can implicitly add
the separator ':' instead of having to include it in the attribute name.
Change-Id: Ie47aa5b76aa3261f4171707f88a203c911536ede
Where the attribute name is known, only pass the name itself as "name"
and pass the rest as "value" for clearer indication of what is what.
Change-Id: I564ce894b1d14b1acfd1f1b351ad2a316688a714
We're in control of all the source strings, so we can just mandate not to
include the leading a= in the string.
Change-Id: If977e97bacc770de140b7ec69b48be8afaab7a0a
gcc <12 propagates the const-ness of the given value to the newly
declared variable with __auto_type, leading to silly "can't assign to
const variable" errors. Work around this with an ugly macro.
Change-Id: Ic952c094c24bd802379fc10ad19d559613b2c1d0
Add handling of SDP session level attributes for:
- `monologue_subscribe_request()`
- `monologue_subscribe_answer()`
This will be used by `janus.c` related functionality.
Change-Id: I1c50b5b9da08e7d8cb2c98eb6995d8610386d6ed
Move `a=extmap:` attribute to the `call_media`'s
`sdp_attributes` using `stream_params`.
Required by the `insert_sdp_attributes()` used in `sdp_create()`.
Additionally revert `extmap` unit test checks in the
`testVideoroomWebRTCVideo`.
Change-Id: If63e4e8733ea0899f34fae1f1d38997e9e2c081c
Move `a=ssrc-group:` attribute to the `call_media`'s
`sdp_attributes` using `stream_params`.
Required by the `insert_sdp_attributes()` used in `sdp_create()`.
Change-Id: I67025dc83dd8e5e46422b6dc1bc54aa9c838dfea
We have to move the list of attributes with following types
to the `call_media`'s `sdp_attributes` using `stream_params`:
ATTR_SSRC
ATTR_MSID
ATTR_OTHER
This is then required by the `insert_sdp_attributes()`
used by:
- `sdp_replace()` -> `replace_sdp_media_section()`
- `sdp_create()`
Additionally: move the `insert_sdp_attributes()`
to the usage of the `append_attr_to_gstring()`, which
gives SDP attrs manipulations control over attributes
being inserted into SDP. Previously not supported.
Additionally: `process_media_attributes()` takes new
argument `bool strip_attr_other`, in order to control
whether or not to strip `ATTR_OTHER/ATTR_SSRC/ATTR_MSID`.
For now there is only one user of it `replace_sdp_media_section()`,
but for later on, we can control this using this bool.
Additionally: `print_sdp_media_section()` takes new
argument `bool print_other_attrs`, in order to control
whether or not to strip `ATTR_OTHER/ATTR_SSRC/ATTR_MSID`.
This is required, because the sdp replacing/creating mechanism
needs a controllable way of adding them, users are:
- `janus_videoroom_join()`
`janus_videoroom_configure()` - always need them
- `call_publish_ng` - always needs them
- `call_subscribe_request_ng` - never needs them
(otherwise leads to a duplication of such attributes)
- `call_offer_answer_ng()` - requires them always
- `call_subscribe_request_ng()` - never needs them
(otherwise leads to a duplication of such attributes)
Change-Id: I9c83d99da1603acb55443c462797b2cd1e72477d
Fix all instances of argument-less function signatures.
Fix all instances of auto-cleanup variables declared after they need to
be in scope.
Change-Id: I3a005df03ede971e08d4f62d7c7711a1913fda5e
This is a fix for the following found defect:
*** CID 1568540: Null pointer dereferences (REVERSE_INULL)
/daemon/sdp.c: 2065 in insert_codec_parameters()
2059 pt->payload_type,
2060 STR_FMT(&pt->format_parameters));
2061 }
2062 if (s_dst->len) {
2063 /* append to the chop->output */
2064 append_attr_to_gstring(s, s_dst->str, NULL, flags,
>>> CID 1568540: Null pointer dereferences (REVERSE_INULL)
>>> Null-checking "cm" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
2065 (cm ? cm->type_id : MT_UNKNOWN));
2066 }
2067 g_string_free(s_dst, TRUE);
2068 }
2069
2070 /* rtcp-fb */
Change-Id: I309fd6268b889ceaf32a58d2fbe17a8c891a95d6
Move processing of removal and substitution
attribute manipulations to the bottom,
after all fixed (well known to rtpengine)
attributes are skipped already.
This is done for media and session level attributes:
- `process_media_attributes()`
- `process_session_attributes()`
This is to add an efficiency to the current processing,
and not do double work.
Change-Id: Idd933f9d85aef5e9a5d597f8825d21e45f43ef37
Add media attributes substitution support to
the following functions:
- `append_attr_to_gstring()`
- `append_attr_int_to_gstring()`
First functions check, if the attribute has to be
removed (by the manipulations profile), if not
then it checks out whether we have to substitute it.
If neither of manipulations have to be applied,
then the given attribute gets attached to the chopper.
This gives support of substitution for
such media level attributes like:
- `mid`
- `label`
- `ptime`
- `ice-ufrag`
- `ice-pwd`
- `ice-options`
etc.
Change-Id: I35a1ad71f1031d986a79446522da2a557c09ddcc
Because the attribute parts variables are declared in
one signle row, these (popping up) commentaries in other
code parts, show only the first code comment for all of the
variables, which makes the code reading confusing.
In order to fix that, declare each one separately, that
gives own code (popping up) commentary per variable.
Change-Id: Iddb94b989844b997055be70a526cca59ab2fddf3
Ignore `a=` during sdp attribute level manipulations
during lookups with the `sdp_manipulate_remove()` and
`sdp_manipulations_subst()`. This is only in:
- `append_attr_int_to_gstring()`
- `append_attr_to_gstring()`
This is required for a proper `str` matching in ht.
Then explicitely add `a=` to the resulting `GString *s`.
Change-Id: I569a356e9a01cffb0068a87a9c6d5a568fe85ecc
In order to be able to remove or substitute `fmtp` parameters,
we have to take care of that in `insert_codec_parameters()`,
since `fmtp` are additionally being printed already after
execution of `process_media_attributes()`.
Change-Id: I78547be13939e161b193beecd8693e22c534fd18
The original sdp_manipulate_check's only purpose left is to check for an
attribute removal. Refactor accordingly.
Change-Id: I3be28e0a2c04461a60766afe7096ad3fb8bbe998
In order to perform a substitution we must do a lookup to the hash table
anyway. We can eliminate an extra lookup for the same key to check
whether a substitution exists by combining the two operations into one.
Change-Id: Ife8f1fbfd77ade1986a303a3a5503f4142f7de01
Operating on an empty queue is essentially a no-op, so there's no point
in doing an extra check first to see if the queue is empty. Remove this
extra check for the CMD_ADD case.
Change-Id: I3c7524cd407fb350a46bdf8d3a91014158c6bf44
Use an indexed array to generically support all possible media types
instead of hard-coding a few possible types. This makes lookup faster
and is also future-proof.
Add helper functions to allocate and lookup the appropriate object.
Change-Id: I28406b2c5a6829330f41601fa52e738d9a8ee315
Media types must be given explicitly anyway, so we don't need to warn
when we encounter a different one, as it's entirely expected that we
won't operate on it.
Change-Id: Ic6b808422ceb5ae857a4d0a99379a1c858bb6fd8
For efficiency reasons `substitute` kind of SDP manipulations
commands have been moved to the `GHashTable` instead of the `GQueue`.
Change-Id: Iec6c44109ae912ba0de440bbed6ecaee6a238b97
1) a=ice-options can be a session-level attribute. Use the correct
lookup function to check for both media-level and session-level
attributes.
2) The RTP endpoint address must be filled in before we do the trickle
ICE check, which uses 0.0.0.0:9 as determining factor.
3) Adapt a test case.
Change-Id: Ic0caffc85791131173848d28f5a652ad9d9124db
Using a pointer array instead of a linked lists allows us to directly
reference a media section by index number, without having to spool into
the linked list.
No functional changes.
Change-Id: I8b0e93f0c2e9addbcb4c938894118ed4a6aec768
Deprecate the `append_attr_to_gstring()` and combine the functionality
of it with the `append_attr_char_to_gstring()` to not have multiple
functions doing same thing.
Change-Id: Id955f79a4f3b0864427216af20b11fd4baeb2b93
Improve an efficiency of the code in terms of not checking anything
inside the function, if the `sdp_manipulation` flags are absent.
Change-Id: I2a5d8cf675a73ec7a2b4af94d5c7fe2f18fc1772
Do not use the `g_queue_is_empty()` to check the emptiness
of the `add_commands_*` GQueue. It's enough to check the pointer
and the first `->head` value.
Change-Id: Ie01f45d5f8bbaa5af3a09594cce145a0e83943c2
Do not proceed to the `g_hash_table_lookup()` if the `attr_name`
is empty.
Additonally: improve slightly the same check for the CMD_SUBST.
Change-Id: I39e34c34b458150ebae38dff5e6a46f6e8f17c66
It substitutes a specified `a=` line taken from the concerned
media attributes list. If such line has been not found,
the attributes list remains untouched.
It subsitutes one attribute at a time, so one attribute into
another attribute.
Change-Id: Ie0a48ba46a1b196fbe33b09dedc40e4498640e34
In order to improve the efficieny of the code (make lookups
faster) use GQueues for CMD_ADD manipulations and
GHashTable for CMD_REM manipulations.
This gives the following benefits:
- faster lookup (check), if any SDP command is to be applied
(no need to iterate through all values of commands, as it used to be)
- keep a sequence for CMD_ADD values given by option flag(s)
In order to keep the code more lightweight and clear,
add a separate struct ptr to queues and hash tables into
the call_interfaces header.
Change-Id: I7e45aca4062750c7b8959473edb410ed76cc04e7
New section of option flags has been introduced for SDP body
attributes manipulations.
Three levels of the SDP session are concerned:
- session level (global one)
- media level - audio
- media level - video
Three different actions are supported for now:
- add
- remove
The value of the command has a wildcard matching approach.
Other attributes apart `a=` can not be edited by this functionality.
So such headers as: `c=`, `s=`, `o=` cannot be touched.
Change-Id: I939d4582839096b2399f7ded865e91ff6eb960a4
(cherry picked from commit 3f06c18793fe95e5b070044a0291a3e1528ac6e4)
Because of the repeating code snippets, which insert attributes
into the SDP chop->output GString, it's just better to introduce
a separate function for that.
This will give one additional advantage — there will be only one
place, where we can control (for example, depending on manipulation
rules) whether to print this attribute or not.
Change-Id: I1b12f2dd2fda8475a783352678ac939267b64080
To better organizea code and not duplicate same functionality
in the future, it's better to handle an insertion of
the sdp_attribute object using a dedicated hanlder.
New handler:
attr_insert(struct sdp_attributes *attrs, struct sdp_attribute *attr)
Change-Id: I24236d81257b95ef98e0886d3ba362cc1e50dfbe