Make sure stats are always added to the `delete` message.
Fixes stats being missing in case of `delete` without from-tag.
Change-Id: I635cc87b91d3e488696f33380b12dc68a24e51ad
(cherry picked from commit 7b28ec4402)
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
Support session level group attribute
for the sdp_create approach.
Additionally: fix the `testVideoroomWebRTCVideo` test,
because as it turned out it used to lose the `a=group:`
attribute before.
Change-Id: I799dfe0dcc5e0708864150cd0e0262a61dd4cc05
For the `sdp_create` based approach, introduce
`a=setup:` handling in cases with the message media
type processing.
Currently this has to be divided for sdp_replace
and sdp_create users. This is because sdp_replace one
uses chopper based approach, which in combination with
changes in this commit dupplicates the setup attribute.
In order to separate the logic both approaches,
introduce a temporary bool, until the time when
sdp_replace gets fully deprecated.
A move of the check out of the `is_active` condition
is required, because the message media type isn't active
and hence has to be checked out of the active context.
Change-Id: I32b8f3f3928ba22e030ab5a6414b93fcd7c47201
When initializing a media for the other side (while
processing an offer), keep not only the `->protocol`
updated, but also the `->protocol_str`, so that this
can be usable while preparing an SDP for it.
Change-Id: I209b9048fae836903c9165c6b87682a06e77a744
Added support of the CT (conference total) bandwidth
attribute for the SDP session level. See RFC8866.
Will be required later for the SDP formatting in `sdp_create()`.
Change-Id: Ifc64f68d7acee8ce253882f4fa480bbf7ad7c0bd
... so that the desired wav channel can be controlled when producing a
mixed audio file
When a mixed wav file is created, the channels in the wav container are
currently allocated in the same order as each SSRC is received, meaning
it is impossible to know which channels have been allocated to the offer
or answer side of the call. Furthermore if there is a reinvite or media
file played, these are also allocated in the order that SSRC is received
- so an "answer" could end up sharing a channel with an "offer" with no
way of knowing this.
This patch allows you to specify how many channel slots should be
allocated within the mixer, and allows you to then specify which slot is
assigned to each media in the call (this will usually be 2 slots in
total, slot 1 for answer, slot 2 for offer or vice versa).
Ported from https://github.com/sipwise/rtpengine/pull/1852Closes#1857Closes#1852
Change-Id: I010208427cabc3a48d6ef7bd3a84e9a5bdcfd492
The subscriptions must be removed first and the update function must be
called second. Otherwise unsubscribe doesn't have any immediate effect.
Closes#1851
Change-Id: Iccc449357f7136b863ba2d633b24942dbe87d767
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
Independently from the fact if a monologue already
has the `->session_sdp_orig` object set, update it
accordingly to the latest origin taken from
the currently processed SDP.
In this case such option flags as `replace_origin`,
`replace_origin_full` or `force_inc_sdp_ver` are
ignored, because their handling is covered using
the `->session_last_sdp_orig` object.
Change-Id: Ib845d185a03a2cb99ead5f6039342388c461cee2
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
While processing subscriptions in `monologue_subscribe_request()`
update the `->session_last_sdp_orig` related to the dest monologue.
This can be then later used in the `sdp_create()` the user
of which is `call_subscribe_request_ng()`.
Change-Id: Iee503ca94f82e0e5334fcd787f984f1ed3f7ca4d
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
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
If already included by the main header (call.h)
then don't do that second time in the implementation (call.c).
Change-Id: I2cabf48cbd3bca00efc68c76b54c582223a10efc
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
Run the SDES reordering routine also when the opposite side is plain
RTP. Add a matching test case.
Ref: https://groups.google.com/g/rtpengine/c/pG6NB24G-BY
Change-Id: I7844290e85e44c1bba2c7665202b6259aead1028
Split the code that handles reordering offerer SDES suites based on the
respective option into its own function. Rework it slightly so that it
reorders the list in place for simplicity. Remove the part that honours
SDES-no and SDES-only as these should affect the opposite (outgoing)
direction. This requires changing one of the test cases, which seems
more correct now.
Change-Id: Ie284d052d72031fad64c94767fa95c74639ae331
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