Remove the actual hash and just keep a linked list. Always move most
recently used entries to the front of the list, which also obsoletes
tracking the last used time stamp.
Change-Id: Id277499228b538dd013a4442e9b5c5a4d247ff15
The GLib slice allocator has been obsoleted. Having a mixture of two
allocators can lead to hidden issues on systems that use different
implementations. Take the leap and replace everything with g_new/g_free.
Change-Id: I025c8383ef47b2c2472573360407fd6a6ca339b3
This mode is only supposed to be used by cases when:
- in-dialog offerer doesn't have own MoH capabilities; and
- still want the recipient to hear the MoH music; hence
- an offerer checks whether a recipient is capable of MoH,
and launches a player based on given capabilities;
- the rest functions the same as with usual MoH hold;
Other information:
- `mode=reflect` is only to be used within dialog,
so, it's not meant for a session origination,
and hence stands alone from other MoH option flags
that actually give a metadata (e.g. blob data)
- `mode=reflect` hence contradicts with `mode=sendrecv`
which in its turn serves another purpose
Usage:
- `moh => { mode => 'reflect' }`
Change-Id: I8d0d55f2711c6b47bfca17691582c1ffe66eae3d
Switch from specialised handling of config sections (used to load
signalling templates) to a more general approach using a callback
mechanism. This allows us to add more information to the config file
while keeping the details of the underlying GKeyFile hidden. Use a typed
hash table for type safety.
Change-Id: I71ddfda0202b47df363bcc5acf1725078774f8f1
Add a semicolon only for the last switch statement
going in a row.
Fixes this Coverity Scan detected defect:
*** CID 1621493: Control flow issues (MISSING_BREAK)
/daemon/call_interfaces.c: 1063 in call_ng_flags_flags()
1057 out->allow_no_codec_media = 1;
1058 break;
1059 case CSH_LOOKUP("allow-transcoding"):
1060 case CSH_LOOKUP("allow transcoding"):
1061 out->allow_transcoding = 1;
1062 break;
>>> CID 1621493: Control flow issues (MISSING_BREAK)
>>> The case for value "15" is not terminated by a "break" statement.
1063 case CSH_LOOKUP("always-transcode"):;
1064 case CSH_LOOKUP("always transcode"):;
1065 static const str str_all = STR_CONST("all");
1066 call_ng_flags_esc_str_list((str *) &str_all, 0, &out->codec_accept);
1067 break;
1068 case CSH_LOOKUP("asymmetric"):
Change-Id: I4d6bc56d8149acd2d0d69f122e420c5a8c6ae2e1
Instead of lumping all strings of a file into a single hash function,
split them up into their respective sections, as there is no point in
matching against strings that aren't part of the switch statement. This
should give a bit of a performance boost.
Nested hash sections require special handling as the wrapper script
isn't smart enough to hande them automaticaly.
Change-Id: I74863dfe6ca412d58101d37f9c9c85078826f1a4
Change old code to directly return `str` objects instead of pointers to
allocated ones. Largely a no-op change but makes some code easier and
eliminates some old kludges.
Change-Id: I2be19dd24bb7ff046d86cc32a3af235283e65dd0
Make `moh-max-duration` available for both
music-on-hold functionality as well as
for the media player.
For that to work, do the following:
- keep `moh-max-duration` config option only for MoH,
if not set (so 0) by default is 1800000ms (half an hour)
- for the play media functionality introduce flag option
`repeat-duration`, by default is disabled
Policy changes:
- duration counter can be used in common with repeats
counter, but then takes a precedence over it.
Hence if first a duration is underflown, then EOF triggered.
Otherwise if the duration counter is still positive, but
repeats are negative, then do EOF based on repeats.
- the repeats counter will always count down during each
iteration, even when used together with the duration counter
For MoH to survive, the repeats counter is simple set to 999
to let the duration counter always win over repeats one
- MoH cannot take duration disabled, since otherwise
would make no sense for it. Hence always takes internally
defined value 1800000ms (half an hour) if not defined
by the configuration option
Backwards compatibility:
- is kept in regards of repeats counter
- is kept in regards of the play media functionality
Change-Id: I48ff3c17c9bed31f80c3106b275b703a9ccb4b26
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
Move conditioning and handling of MoH
into a separate helper to make code a bit
more laconic.
No functional changes.
Change-Id: I89502bbdfe75e0b96c42ac0bde405e3ed04403fa
Add duration limit for the moh functionality.
This is required due to a possibility to get
monologues and hence packet streams stuck
forever and sending audio to recipients
which already don't exist.
A configuration option that controls that:
`moh-max-duration` - gets a value in milliseconds.
By default is set to 1800000 (half an hour).
Change-Id: Id50a0a10ce5b52b3876a3122fb16a71accec90ff
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
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
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
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
There is enough overlap between the two enums that it doesn't make sense
to carry along both. Unify.
Change-Id: I9de8fbdb8d78a2002d8c1b62cea57188c937d61d