MT#61630 moh: introduce `moh-max-repeats`

Introduce `moh-max-repeats` configuration option,
which controls the `rtpe_config.moh_max_repeats`
used when initializing media player options
for the music-on-hold functionality.

By default is always set to 999,
if not defined otherwise.

Change-Id: I247dc532a6871934e44f9c4002313363356937fb
pull/1897/head
Donat Zenichev 11 months ago
parent 67bfa5a5df
commit bfe747e9bc

@ -113,6 +113,7 @@ struct rtpengine_config rtpe_config = {
.dtmf_digit_delay = 2500,
.rtcp_interval = 5000,
.moh_max_duration = -1, // disabled by default
.moh_max_repeats = 999,
.common = {
.log_levels = {
[log_level_index_internals] = -1,
@ -698,6 +699,7 @@ static void options(int *argc, char ***argv, GHashTable *templates) {
{ "janus-secret", 0,0, G_OPTION_ARG_STRING, &rtpe_config.janus_secret,"Admin secret for Janus protocol","STRING"},
{ "rtcp-interval", 0,0, G_OPTION_ARG_INT, &rtpe_config.rtcp_interval,"Delay in milliseconds between RTCP packets when generate-rtcp flag is on, where random dispersion < 1 sec is added on top","INT"},
{ "moh-max-duration", 0,0, G_OPTION_ARG_INT, &rtpe_config.moh_max_duration, "Max possible duration (in milliseconds) that can be spent on playing a file. If set to 0 then will be ignored.", "INT"},
{ "moh-max-repeats", 0,0, G_OPTION_ARG_INT, &rtpe_config.moh_max_repeats, "Max possible amount of playback repeats for the music on hold. player-max-duration always takes a precedence over it.", "INT"},
{ "max-recv-iters", 0, 0, G_OPTION_ARG_INT, &rtpe_config.max_recv_iters, "Maximum continuous reading cycles in UDP poller loop.", "INT"},
{ "vsc-start-rec",0,0, G_OPTION_ARG_STRING, &rtpe_config.vsc_start_rec.s,"DTMF VSC to start recording.", "STRING"},
{ "vsc-stop-rec",0,0, G_OPTION_ARG_STRING, &rtpe_config.vsc_stop_rec.s,"DTMF VSC to stop recording.", "STRING"},

@ -1293,7 +1293,7 @@ const char * call_check_moh(struct call_monologue *from_ml, struct call_monologu
{
const char *errstr = NULL;
media_player_opts_t opts = MPO(
.repeat = 999,
.repeat = rtpe_config.moh_max_repeats,
/* MoH always has duration set (even if not defined) */
.duration_spent = rtpe_config.moh_max_duration,
.start_pos = 0,

@ -156,6 +156,11 @@ recording-method = proc
# When not defined (set to 0), it takes 1800000ms default value.
# moh-max-duration = 1800000
# music-on-hold max possible repeats.
# moh-max-duration always takes a precedence over it.
# By default is always 999 if not defined otherwise.
# moh-max-repeats = 999
# signalling templates (see key `templates` above)
[templates]
WebRTC = transport-protocol=UDP/TLS/RTP/SAVPF ICE=force trickle-ICE rtcp-mux=[offer require] no-rtcp-attribute SDES=off generate-mid

@ -40,6 +40,7 @@ enum endpoint_learning {
X(final_timeout) \
X(offer_timeout) \
X(moh_max_duration) \
X(moh_max_repeats) \
X(delete_delay) \
X(redis_expires_secs) \
X(default_tos) \

Loading…
Cancel
Save