Move part of the `call_stop_media_ng` function body
to a separate function, to let it be available
for external function calls not particularly related
to play media NG function call.
Change-Id: I278f7bc5a6663e9232e812d10f6902616c67c497
Make most of implementations static to file
because used only locally:
- `media_player_play_file()`
- `media_player_play_blob()`
- `media_player_play_db()`
- `media_player_add_file()`
- `media_player_add_blob()`
- `media_player_add_db()`
Change-Id: I0db13e1f851e6c59d29ffb5adf5cb8d01bfd5bcc
`media_player_opts_t` is already used to pass
blob, file and db_id, hence makes no sense to pass
it one more time and reset parameters of
`media_player_opts_t` strcuture in actual implementation
to the same value again.
Change-Id: I97f4236b2c9565f12af44dc4aba85ebfc6d8cefa
Use `media_player_opts_t` object to pass file, blob and db_id
parameters via the following functions:
- `media_player_add_file()`
- `media_player_add_blob()`
- `media_player_add_db()`
Change-Id: I7612cd63d08bc00911ba68c0a5a81796d50d4722
Rename the following functions into
something more relevant so that it
doesn't correlate with the general
init function `media_player_init()`
which isn't call specific.
- `media_player_init_file()` > `media_player_add_file()`
- `media_player_init_blob()` > `media_player_add_blob()`
- `media_player_init_db()` > `media_player_add_db()`
Change-Id: I8efd877bfd4c7c300aec7efe6fbbb654f52de460
Pass file, blob and db_id via `media_player_opts_t`
structure members instead of using separate arguments
in `call_play_media_for_ml()`.
Change-Id: I8c3b9b7f5ab61238d35463c304246f31a922ac6f
Move part of the `call_play_media_ng` function body
to a separate function, to let it be available
for external function calls not particularly related
to play media NG function call.
Change-Id: Iaf4e8f72f1492446508fd6b49ba36434cae5f5f0
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
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
New helper function to create a new call without closing previously
opened ports.
Also make it possible to override the automatically inserted call ID in
methods.
Change-Id: Ie9133f78bc7bd5ff4e191966ef26187da02e40ff
Create a dedicated helper function to remove a call from the global call
hash based on a particular call ID.
No-op as this just splits out the relevant code.
Change-Id: I24e4bd89be882a1d941c5e09cada9cb055982f24
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
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 many transcoding scenarios resampling is not actually required. We
can shortcut the operation by just returning the original frame, instead
of a cloned and newly allocated one. We just need to distinguish between
the cases to determine whether the frame returned by resample_frame()
needs to be freed.
Change-Id: I3f36a46bd3b967f140c8353119fdb24ad8363c15
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
Some compilers seem to think that there is some uninitialised usage
here. Work around this.
Closes#1891
Change-Id: Ic97a4b589fd2a0c33418a209557b7ce29009c7bf
If recording-method is pcap, then proc is zero-initialized, so
meta_filepath is empty. This shows many logs such as:
[core] Failed to open recording metadata file '(null)' for writing: Bad address
Prevent them by returning earlier.
Closes#1889
Change-Id: Ifeb3038f9a5c0bd6a9b7dd92842dd61783b40263
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
- LTS mr11.5.1 doesn't build with system GCC 8.5 on EL8
- add a workaround for using GCC 13
Closes#1887Closes#1886
Change-Id: Ib93942fae8f754c7673509ccb45e0d08569f23f0
Addresses: #1886
For some reason gcc 10.2.1 complains about this instance with
control_ng_flags_parser.c: In function ‘parse_transports’:
control_ng_flags_parser.c:299:2: warning: missing initializer for field ‘remainder’ of ‘rtpp_pos’ [-Wmissing-field-initializers]
299 | call_ng_main_flags(&dummy_parser, &STR_CONST("transport-protocol"), &(rtpp_pos) {.cur = STR(val)}, out);
| ^~~~~~~~~~~~~~~~~~
In file included from ./log.h:7,
from ../lib/obj.h:105,
from ../include/control_ng_flags_parser.h:7,
from control_ng_flags_parser.c:1:
../include/types.h:48:6: note: ‘remainder’ declared here
48 | str remainder;
| ^~~~~~~~~
but doesn't complain about other instances of the same usage. Oh well.
Make it shut up.
Change-Id: I6989e3c63b075b6c8f258a824557b767123dc0f6
The opmode is already determined uniquely when processing the NG
command. There is no need to explicitly set it again elsewhere. Simply
carry along the originally determined opmode.
Change-Id: I16924264b0337423aff6763c70a4b2c6dd3687db
These macros were used for development only and are not needed any more.
Their names collide with an upstream patch, making compilation fail on
kernels >= 6.12. Just remove these wrapper macros altogether.
Change-Id: I6e154be76bfcfb650581095b169ddd58e5f464a0