0x40000000 was already used by SHARED_FLAG_END_OF_CANDIDATES. Move
MEDIA_FLAG_REORDER_FORCED to unused slot 0x00800000 instead.
Change-Id: I0aa33854f814757869c7a98ba209d9aeb94d3d91
(cherry picked from commit 443a07a58d)
We know whether we're printing for monologues or for medias, so there's
no need to have a generic function signature.
Change-Id: I356747686adb34c19ba2ba4c77c2d0a77b85a364
(cherry picked from commit e0e4ba5b7c)
A call that gets created but then doesn't get initialised would have its
Redis DB left at zero. At destruction it would then try to switch to DB
zero. Fix this by using an appropriate initial value.
Closes#1905
Change-Id: I852e48c5a06b732b37d2ccd5c478de4760aacd4e
Introduce global generic memory arena variable, instead of having just
a call-specific memory arena. This makes it possible to use memory arena
outside of call contexts. Define previous call-specific functions in
terms of the generic ones.
Change-Id: Icde4f63f02dacbf8abfbaf107ea8b5bbe18d5eb8
Support inactive hold, because some
client implementations (such as Zoiper5)
are using `a=inactive` for their holds.
For us this means, either of this
puts the other side on hold:
- `sendonly: !MEDIA_ISSET(media, SEND) && MEDIA_ISSET(media, RECV)`
- `inactive: !MEDIA_ISSET(media, SEND) && !MEDIA_ISSET(media, RECV)`
Change-Id: I75562eee60220885e233fa965bf22da92850a8f4
Introduced Music on Hold functionality:
- available only for the offer/answer model,
no other scenarios (publish, subscriber etc.)
are covered with it
- it gets advertised always at the beginning of
the call (original offer/answer exchange)
- can be added for both sides: offerer/answerer
- the one who advertises its MoH capabilities
with its SDP offer or answer, can later trigger
MoH using sendonly SDP and unhold remote
party using sendrecv SDP
- MoH covers only audio type of media sessions
- there is no specific selection of media sections
to be held, thus, if one audio media puts the
call on hold, the whole call is held
- list of parameters to be given when advertising
MoH capabilities: a sound source (file, blob or db source);
sendonly/sendrecv hold; zero-connection hold;
At least an audio file source must be given
- MoH cannot be mixed with the play media functionality,
the last one triggered will override previous one
- MoH must be unheld to stop the media being sent
towards a recipient, otherwise only a termination
of monologues will stop this packets stream
Change-Id: Iefd83ced79c14dadad936348a1d529007d6e7b3b
This function connects two call legs (two monologues), possibly from
different call IDs, into a single media flow. It pays attention to media
types and automatically engages transcoding if needed. The order of
media sections of different types can be differend between the call legs
that are being connected. Subsequent reinvites will produce SDPs with
the media sections in the correct order.
Change-Id: I40c3363997de169edc553733d52acdfd9f0181ad
This function retrieves two calls from the global call hash while
avoiding deadlocks. This is needed because a "call_get(A) + call_get(B)"
would deadlock against a concurrent "call_get(B) + call_get(A)"
Unused at this point.
Change-Id: I95127ce1afa19386a847984ca26eb7d7368e6569
This function merges two distinct call objects into one. All contained
objects are moved, and the "source" call is then destroyed. Both call
IDs can then be used to refer to the same internal call objects. Call ID
aliases are kept in a list in the call object.
Change-Id: I8a37775fe0dc3e7ccfeb83e2a3b7d751601450fc
When media subscriptions are removed implicitly by
__subscribe_medias_both_ways(), we must update all RTP sink pointers of
all the streams of the affected medias. Otherwise these sinks will be
left unchanged despite the subscriptions having been removed.
Change-Id: I6d1ac3bb5cb27443c31f0f3b9ce8f47c416cd3ce
The `answer` processing empties out the list of codecs and leaves only
those that were accepted in the answer. Side effect of this is that if
another answer with a different list of codecs comes through, them the
codec-accept function is missing the original list of offered codecs and
can yield an incorrect result.
Fix this by storing a copy of the offered codecs at the end of the
`offer` processing, and then restore this list at the beginning of each
`answer` message.
Change-Id: I3c714e80689f3c5689637cc7d1eb2f203c292a15
There is enough overlap between the two enums that it doesn't make sense
to carry along both. Unify.
Change-Id: I9de8fbdb8d78a2002d8c1b62cea57188c937d61d
Allow to-tag updates in answers only until a non-provisional response is
received. Add a flag to optionally suppress this feature.
Change-Id: I67110ede662f618ba5a355500d3d84050e6318cc
If a monologue is determined to get a new to-tag, don't just overwrite
the previous to-tag, but also save the old one as an alias. Leave the
old one in the hash table as well so that future lookups can use either
to-tag.
Change-Id: I5d2d5cc17c85ec4ca2d8a20c501d2cdb6d793b61
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
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
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
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
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
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
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
Obsolete str_init(), rename STR_INIT() to just STR(), and replace all
instances of str_init() with STR().
no-op
Change-Id: I981529063ad2ea26089add467f7a84b638dbf423
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