MT#61630 moh: mark music-on-hold SDPs

Mark those SDPs which trigger processing
of music-on-hold.

Is defined by the config option:
`moh-attr-name`. If not defined then
is not used.

Will be useful for cases when it's important
for remote components to detect ongoing hold.

Change-Id: I0f2a284955dbc045b51920174f1f4fbefcb93907
pull/1897/head
Donat Zenichev 4 months ago
parent 51a0175ae7
commit 30b42d8d19

@ -700,6 +700,7 @@ static void options(int *argc, char ***argv, GHashTable *templates) {
{ "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"},
{ "moh-attr-name", 0,0, G_OPTION_ARG_INT, &rtpe_config.moh_attr_name, "Controls the value to be added to the session level of SDP whenever MoH is triggered.", "STRING"},
{ "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"},

@ -1317,6 +1317,8 @@ const char * call_check_moh(struct call_monologue *from_ml, struct call_monologu
{
/* whom to stop the moh audio */
call_stop_media_for_ml(to_ml);
/* mark MoH as already not used (it can be unset now) */
to_ml->player->moh = false;
}
return NULL;
#else

@ -20,6 +20,7 @@
#include "call_interfaces.h"
#include "rtplib.h"
#include "codec.h"
#include "media_player.h"
enum attr_id {
ATTR_OTHER = 0,
@ -2821,7 +2822,11 @@ static void sdp_out_add_other(GString *out, struct call_monologue *monologue,
/* add loop protectio if required */
if (flags->loop_protect)
append_attr_to_gstring(out, "rtpengine", &rtpe_instance_id, flags, media->type_id);
#ifdef WITH_TRANSCODING
if (monologue->player && monologue->player->moh && rtpe_config.moh_attr_name) {
append_attr_to_gstring(out, rtpe_config.moh_attr_name, NULL, flags, media->type_id);
}
#endif
/* ice-lite */
if (media_has_ice && media_has_ice_lite_self)
append_attr_to_gstring(out, "ice-lite", NULL, flags, media->type_id);

@ -161,6 +161,10 @@ recording-method = proc
# By default is always 999 if not defined otherwise.
# moh-max-repeats = 999
# controls the value to be added to the session level of SDP
# whenever MoH is triggered. If not defined, then not in use.
# moh-attr-name = rtpengine-hold
# 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

@ -125,6 +125,7 @@ enum endpoint_learning {
X(redis_hostname) \
X(redis_write_hostname) \
X(redis_subscribe_hostname) \
X(moh_attr_name) \
X(spooldir) \
X(rec_method) \
X(rec_format) \

Loading…
Cancel
Save