The nested if-statement is correctly written,
but visually is fragile. Simple curly braces will prevent
anyone in the future introducing a dangling-if style mistake.
Change-Id: I3632702390f046c317eac4e5fef76bc7db707081
In the list of functions return actual err string.
And pass it up to the flags parser, which will return
the actual error if given.
This also will be used by call-backs.
Change-Id: I0d65508afb35763bb0673219d711df22f874b98f
If in the future `call_ng_flags_str_pair_ht()` starts returning
an error as string, pass it up to the caller's caller, in this case
`call_ng_flags_sdp_attr_helper_subst()`.
Change-Id: I59cd988bc30f62c2de159e614a195f8c1182814c
As other methods around (e.g. attr manipulations) log
in case the wrong type is used, do the same for sdp
media removal.
Change-Id: I576763c698431637aa5647b955178c3a25485806
If the type is wrong, just return.
This make it consistent with the rest of attr manipulations
helpers around.
Change-Id: I4fa8aba6ef8fa382e36b2042e60b51df7ad10494
Expression like macroses should usually be
wrapped in parentheses.
Then they behave predictably, when for example
embedded into larger expressions,
and also so future edits do not accidentally introduce precedence bugs.
Change-Id: I4ac485c2e1ed58507f4efeec69de63a6080523c2
With timestamps handling, which want to operate on signed integers.
Return the signed max value given from the calls of `atomic64_get_na()`.
Raw-cast the output of `atomic64_get_na()` to the signed integer as well.
Change-Id: Icc6878c9b08545f456ad5eb267ed6a3333c11ab7
Some duplicated usage of `__monologue_unconfirm()`
on the same monologues after the latest refactors
(removal of `dialog_unconfirm()`).
Change-Id: Ic61b0f81382cedf3c7fe59d0f78762ec5a55d3f3
The `dialog_unconfirm()` func simply does similar
work as `__monologue_unconfirm()` but works instead
on subscriptions additionally.
So just deprecate it and then `__monologue_unconfirm()`
just takes the work on subscribers/subscriptions as well.
Change-Id: I047fd86b8eba700d0347b21137a2aa40fab01643
It never returns anything apart 0 (`ret` always remains
set to the originally defined 0).
So just make it returning void.
Change-Id: Ibc0a1b86f1820055f3459dacbdfea0274fbf7377
The bitmask `& 0x7f` on m_pt guarantees values 0-127, and the decoders
array has 128 entries, so out-of-bounds access is structurally impossible.
Add a compile-time static_assert documenting this invariant.
Closes#2107
Change-Id: I9debd6ddf4ac928ded71d2189775e10dee98e0de
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add the 'all' keyword for the codec accept option in publish mode:
- 'all': keep all codecs supported for transcoding and their
supplemental codecs, removing only unsupported ones
- 'all' + 'any': keep all codecs from the offer without removing any
Closes#2105
Change-Id: Ic271a5e461703e3b9dba3c0717bfbb9da89a03ca
It doesn't make sense to produce an answer SDP with ICE attributes (and
enabling ICE processing) if the offer didn't indicate ICE support.
Closes#2106
Change-Id: I7cc6083beffc3f76f34c965049e8179866df2e6f
Check what it actually returns and accordingly return false
in case of error to the `monologue_call_create_media()` caller.
Change-Id: I90b8069dcc770187aabefb40d96c1c6929c2f703
Check what it actually returns and accordingly return -1
in case of error to the `monologue_subscribe_request1()` caller.
Change-Id: I5a14a19c97c1ca51d212d133670bbd8e8158628e
Check what it actually returns and accordingly return -1
in case of error to the `monologue_publish()` caller.
Change-Id: Ibcf8e71bc1234787654667b04afd43db5cebe5bb
This wrapper should likely call the `__unsubscribe_all_from_monologue()`
instead of the `__unsubscribe_monologue_from_all()`, because
the latter is already used by another wrapper of the same name.
And "unsubscriber all from monologue" name hints that
we unsubscribe our subscribers from us.
Change-Id: I6a16ab7320c619adedd9ba7c05e0d9a401971bfe
Running the Docker image raises the following exception:
```
rtpengine: error while loading shared libraries: libip4tc.so.2: cannot open shared object file: No such file or directory
```
Adds libip4tc for ipv4 handling
Closes#2102
Change-Id: I102c83652e1b52b0026fe873164a06e116b5daa5
Comparing the `unsigned int` against -1 leads
to comparison of the maximum value representable by unsigned int
(UINT_MAX).
Use explicitly the `UINT_MAX` instead.
Change-Id: Ib1e435c25d481ae680fd3d3f3cb74ec1c7d6109d
Not only the `.name` and `.value` but also the rest
(so the `.line_value` and `.key`).
If not to do so, this may affect future generic logic.
Change-Id: I786aa52233af6bf4324ed401873df42fc7f63c46
If `a=` has been given as part of the manipulation flags,
then this would lead to appending `a=a=`, so instead check it,
and if already there, then skip adding our own.
Change-Id: If943fac403fc3942cad8ad89be14fe4689b9974e
Add assert for the case when the execution sequence:
`get_any_interface_address()` -> `get_interface_address()`
still returns NULL.
If to dereference the `local_intf` later without checking it,
then it's definitely a crash.
Change-Id: Idc8557dd5352a6a421ca4056ef1ebd822be5fe08
For the case when we fail in during streams allocation
in `sdp_streams()` we only take care to clean the
main pointer for the stream params, but not about
the subsequent heap allocated stuff like SDES params.
For this purpose we actually have `sp_free()` which takes
care to de-allocate subsequent heap allocated queues.
Change-Id: I326bc91c9194752e901406dc919da9c4ef5aa51a
In `sdp_out_add_media()` the port is given as
`unsigned int` but then is being appended to the SDP body
as `%i`. Instead the `%u` should actually be used.
Same for the `sdp_out_add_osrtp_media()` which treats
the `unsigned int` as the `signed` one actually.
Change-Id: I6a7a45e9a0daa70ffffd17d2a35ff7db8c8cf7ab
Fixes:
*** CID 1671239: Control flow issues (MISSING_BREAK)
/daemon/call_flags.c: 1902 in call_ng_main_flags()
1896 case CSH_LOOKUP("rtcp-mux"):
1897 case CSH_LOOKUP("RTCP-mux"):
1898 case CSH_LOOKUP("rtcp mux"):
1899 case CSH_LOOKUP("RTCP mux"):
1900 return call_ng_flags_str_list(parser, value, call_ng_flags_rtcp_mux, out);
1901 case CSH_LOOKUP("rtpp-flags"):
>>> CID 1671239: Control flow issues (MISSING_BREAK)
>>> The case for value "164" is not terminated by a "break" statement.
1902 case CSH_LOOKUP("rtpp_flags"):;
1903 case CSH_LOOKUP("rtpp flags"):;
1904 /* s - list of rtpp flags */
1905 out->rtpp_flags = true;
1906 parse_rtpp_flags(&s, out);
1907 break;
Change-Id: I1d8c41ad08c5f090fe58ab0b5c03308b9a1155bb
Add RED (RFC 2198) codec definition to codeclib as a supplemental codec.
Modify codec_store_accept_one() to preserve supplemental codecs whose
clock rate matches the accepted primary codec. Skip supplemental codecs
in codec_store_is_full_answer() since they are optional in SDP answers.
Closes#2100
Change-Id: Ie81f45091c5d3dc55e20896d5a6e7a8361fda2f4
The ffmpeg G.726 encoder operates on fixed frame sizes which don't
reflect the expected frame size on the wire. Add an encoder init wrapper
to set the correct frame size.
Change-Id: I4d635e52b6c3bd4f924d1b295ec1bf4c56ef22bc
In case of bitstream style codecs which still use an encoder which
operates on fixed frame sizes (e.g. G.726), passing the maximum allowed
frame/packet size to the packetizer is not enough. Instead it needs to
know separately how much data it is expected to return. Add another
argument to pass this information.
This also fixes the incorrect math to adjust the frame duration in case
of chunked output.
Change-Id: I1d57c684ecea055059481de0220f6b6001088605
Instead of taking an average, take the minimum over the last X frames.
This fixes skew calculation in situations where the encoder is expected
to produce burst output (e.g. G.726).
Probably the exception for media playback can also be removed.
Change-Id: I92e03916c04c670f6e8e72ad243a67d675504690