Use the correct media object (the source media) to obtain media-level i=
lines from. Adapt OSRTP output function to do the same.
Change-Id: I9ba4db286cf9d822b8986a7da2cb4f4aa1c69646
Support the recvfrom() function. This requires also returning to address
(not just the port) from the tester's rcv() function to be useful, which
in turn requires updating a bunch of tests.
Change-Id: I3c0bcab9b744f2c234662399199abc538876c4fa
The codec `strip` option used to remove codecs not only from the
destination (offer to) monologue, but also from the source (offered by)
monologue. Change this to only affect codecs on the destination
(offering to) side. This fixes a problem of not being able to have
different `strip` options set for different branches.
As a side effect, this breaks existing use cases of using `strip` to
ignore codecs on the source monologue side. This functionality is
restored by adding `codec-ignore` in the following commit.
Change-Id: I022748fffc29caa3a8c96f514b2021f152e43686
Add a couple of tests for the following cases:
- use both zero-connection + mode sendrecv flags
at the same time
- answerer puts on hold (instead of offerer)
Change-Id: I5f849aa6b79a2e7e31512fbad9d2b82a6f5b0027
Sendrecv mode flag controls whether the sendrecv
state is forced to sendrecv, instead of the default
one sendonly, in the SDP body going towards recipient
(the one who will receive the MoH media).
Is declared as: moh=[mode=sendrecv]
Can be useful for corner cases, where the remote side
wants to see sendrecv state for whatever reason,
when getting MoH media and hence also remain in sendrecv
state in regards of the MoH originator.
Must be advertised once during the session origination,
nd then will affect the SDP body as soon as SDP sendonly
body is received (from the behalf of one, who advertised MoH
capabilities).
Backwards compatibility: doesn't affect non-MoH calls.
And doesn't affect offer/answer exchanges within MoH calls,
which do not put the remote side on hold.
Additionally: introduce a common function for the MoH flags
handling: `call_ml_moh_handle_flags()`, which does all
the required iterations/checks for the whole bunch of flags
at once.
Additionally: previously existing MoH tests adopted.
Additionally: new test introduced to check the SDP content,
when using mode sendrecv flag.
Remark: this flag is not mutually exclusive with
the zero-connection MoH flag.
Change-Id: I5bf6699f6890d8b927107cc143a18116efe45087
Zero-connection flag controls whether the connection
address offered in the SDP body going towards recipient
(the one who will receive the MoH media), is set
to all zeroes.
Is declared as: moh=[connection=zero]
Can be useful for older client implementations,
who want to see zeroed media when receiving sendonly
and getting put on hold.
Must be advertised once during the session origination,
and then will affect the SDP body as soon as SDP sendonly
body is received (from the behalf of one, who advertised MoH
capabilities).
SDP body recovers to the real IP addresses being inserted
into recipient's SDP, as soon as the media gets unheld.
Backwards compatibility: doesn't affect non-MoH calls.
And doesn't affect offer/answer exchanges within MoH calls,
which do not put the remote side on hold.
Additionally: previously existing MoH test adopted.
Additionally: new test introduced to check the SDP content,
when using zero-connection flag.
Change-Id: If0c38a3d294e6d5fe3886bee19ff2382e5705f9a
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
Fix for "opus<>opus+DTMF" auto test.
Receive when port is already known.
Fixes:
Use of uninitialized value $port in numeric eq (==) at ../perl/NGCP/Rtpengine/AutoTest.pm line 239.
Change-Id: Ic0089bae769ccafeb7145e703a6e21029da85a97
To support scenarios with mismatched media sections between two sides of
a call that aren't based on explicit SDP manipulations, attempt to
lookup the peer media based on an existing subscription also for offers.
Add extra checks (media type, media ID, monologue pointer) to make sure
that the obtained media object is actually the correct one.
Use a fallback on the existing index-based lookup in case no matching
media can be found.
As a side effect, the numbering and ordering of media objects created
during offer/answer is now reversed as the function is called in a
different order. Adapt tests as needed.
Change-Id: Ia5351f7d4fed03098c6be6bea3d4c74f52b8a76b
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
In some cases, in particular when multiple input codecs are transcoding
to the same output codec (e.g. audio + DTMF -> audio), it's possible
that one of the input decoders produces frames in a format different
from the one expected by the encoder. Add an encoder-side resampler to
compensate for that.
Change-Id: I74d55edf47ac2fa65f950e68f4a5975f1ab947bb
In order to be able to control, which media types
one wants to have in the call session,
add support of the "sdp-media-remove" flag.
Syntax:
"sdp-media-remove" : ["<media-type>", "<media-type>", ...]
Additionally, add according unit tests.
Change-Id: Ic52456f8124319992ea9ca8c161daefb1df46b59
These are too sensitive to timing and random events to run them on a
regular basis. Turn them into tests that must be enabled explicitly.
Change-Id: I574e3cbe140234362079ad9fd5fdc9d3c85697c8
Add support for simplified G.107 formula, with math changed to
fixed-point. Retain legacy formula as an option for backwards
compatibility.
Change-Id: I999fc7de7be1407876c201c251538cea72b04008
Refactor inactive streams handling (non-accepted media) so,
that they get also labels being printed.
Change-Id: I6627aba77a5f391f797762202eb4f0977bc0fc4a
Move the SDP offer/answer model to the sdp_create
approach instead of using the sdp_replace one.
This assumes the SDP body including session level
attributes (s=, o=, t= etc.), as well as the media
attributes, are formatted using currently given
session context.
In other words, rtpengine collects all possible
information during all of the offer/answer exchanges
within the dialog, which in its turn affects each
monologue's context, from which each new SDP message
will be built up.
This approach replaces the older one, which instead
used to go through the currenty processed SDP and
just replace those attributes, that rtpengine
is required to affect, leaving the rest untouched.
Additionally: all of the existing offer/asnwer model
tests were fixed to comply with the currect change.
Most of it is just an offset of attributes, which are
stored a bit higher/lower within the same media or global
SDP session.
Also a good part of unit test fixes targets a move of
`c=` line from the session level to the media one (so
each media has from now on its own `c=` attribute). This
does discontinue a support for session level connection
information.
Change-Id: Iecb4739683d23c4f9341e8a34b71f8ca2070956c
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
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