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
{"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,"Music-on-hold max possible duration (in milliseconds). If set to 0 then will be ignored.","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"},
{"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"},