The documented behavior is:
- if not set at all, set to 180s by default
- if set to 0, then will be ignored in media player
- if set to > 0, then will be used to set the value
Current code is inconsistent, 0 is always reset to 180s,
hence 0 value can never lead to ignoring.
Only reset to 180s the `-1` (default value, means never parsed).
Also clarify a little bit more the description of the option.
Change-Id: I5c3e63ffaca6271424783eeba828578e54c819e5
Check that `silence_detect` is in the range 0-100.
Also properly cast to actual `silence_detect_int` type which
is `uint32_t`.
The reason is that in the current code this can exceed `INT_MAX`
(for values near or above 50%) and also, values above 100% are not rejected.
Change-Id: Ic2359402879412926b18125e292c1969cda45203
Since this is parsed as type int, potentially can be given as -1.
Hence don't accept the range < 0 and > 2.
Change-Id: I8cdbf6e7626ec89bcd287742ddfbd49a3e1a3c90
In case when parsing fails in `redis_ep_parse()`
and it returns -1, we never de-allocate the actually
duplicated strings before (using `g_strdup()`).
For example with redis subscribe, where we have a fallback,
will leak and overwrite previous allocations.
So just free what's been allocated on the failure case.
Change-Id: I340f8998de9de80342f293c669719bea7c3a2a97
Already used by `--no-fallback`, so the rest just probably
inherited the same letter when doing copy-paste.
That is ambiguous and may cause option parsing conflicts.
Keep `F` only for the historical(most important) option
and set the rest to 0.
Change-Id: I6e4841f6e6614bfdfcf53d159130d6d676073d47
We indeed already didn't support it, just silently ignored.
Now just completely drop support even in flags parsing.
In the documentation it was removed already a long while ago.
Accordingly update tests and utils.
Change-Id: I2de8ad24b77aa5f43270640559bf809ed1c565bc
First check if the given `command_action` is a dict, and only then
allocate manipulation object. Because otherwise it still creates
an object, but then if the `command_action` isn't a dict,
it just returns. So useless. Hence re-order them.
Change-Id: I50bd334d8b945a5dd5177202168ef21cf2915458
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
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
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
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
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
The format of a received audio frame can differ from the required format
for the audio player (Opus decoder supporting multiple sample rates).
Add a resampler in case resampling is needed.
Change-Id: I7f1be18334a5a12c6491e7763699559d2ee487f1
Some containers (MP3) fill the audio format information only after
reading the first frame. Do that if the information is missing.
Change-Id: I7865dee130e2a109e289eca5119d38a4e00f2a32
Skip initialisation of seq_out to a random number and track its init
state with a dedicated flag. Initialise it to the first received seq.
Change-Id: Iecdd3d28c5d6fe36d0a7488dd231767ff788942e
Don't blindly take over a source DTMF PT if one is present. Check if the
destination has _some_ DTMF PT, and only then take over the source. This
makes the behaviour more closely match the documentation.
One test is affected and seems to improve its outcome.
Closes#2091
Change-Id: Ibb9c1f79099fa30ac69ec71b4a4c71af0b88b327
Update all linked subscribers, not just the ones involved in the
connect, as they might also need to have their handlers updated.
Change-Id: Ib7a8aa3ca0d0f986bb90a99bf1337b358e96be33
Instead of always blindly picking the matching supp codec for the
receiver codec, pick it only if there is no appropriate sink supp codec,
or both are compatible (which implies a payload type mismatch).
Closes#2084
Change-Id: Ie401db500a038f60f3b4286e2067f90674c611df
Move o= replacement logic into sdp_out_add_origin. Copy fields from
input source ML if present, or keep unchanged. Generate if not present.
Change-Id: Ieea5abea05bf076262248639118e9e9192f77e1c
This is needed to correctly print media labels for SIPREC in case the
input SDPs already had media labels.
Change-Id: I021f44ba28a3648ceb62db12425ddf545de42a96
The `created_from` address string includes the port, which must be
removed when substituting it for the RPC URL.
Fix-up for Ib67b57b1d
Change-Id: Iaa33ec660d21736f8b075f36479ba2734a480a4a
For a repeated subscribe-request on an existing monologue, make sure
that existing media sections are re-used for the same subscriptions as
they were previously, and only create new ones in an append-only fashion
for media subs which didn't previously exist.
Change-Id: I410c6af17eb31a5c5c43c78a7f82ba867f8480b7
New NG protocol commands that mix audio from a source participant
into a destination participant's stream without a full offer/answer
exchange.
- inject start: creates one-way subscription with audio_player mixing
- inject stop: removes injection and restores original codec routing
- Supports cross-call injection via source-call-id (merges calls internally)
- inject attribute persisted through Redis for HA failover
- Audio-only; matches media by media-id, index, then type fallback
Closes#2082
Change-Id: Ib88113b021a4b76bf98892eb1af60c0b36c0d6d3