diff --git a/docs/examples/config b/docs/examples/config index 775a56a33..873692dc4 100644 --- a/docs/examples/config +++ b/docs/examples/config @@ -255,6 +255,7 @@ video_selfview window # {window,pip} #menu_max_earlyaudio 32 #menu_max_earlyvideo_rx 32 #menu_max_earlyvideo_tx 32 +#menu_message_tone yes # GTK #gtk_clean_number no diff --git a/modules/menu/menu.c b/modules/menu/menu.c index 38c5703f3..63c3770f0 100644 --- a/modules/menu/menu.c +++ b/modules/menu/menu.c @@ -976,8 +976,10 @@ static void message_handler(struct ua *ua, const struct pl *peer, ui_output(baresip_uis(), "\r%r: \"%b\"\n", peer, mbuf_buf(body), mbuf_get_left(body)); - (void)play_file(NULL, baresip_player(), "message.wav", 0, - cfg->audio.alert_mod, cfg->audio.alert_dev); + if (menu.message_tone) { + (void)play_file(NULL, baresip_player(), "message.wav", 0, + cfg->audio.alert_mod, cfg->audio.alert_dev); + } } @@ -1170,6 +1172,7 @@ static int module_init(void) menu.clean_number = false; menu.play = NULL; menu.adelay = -1; + menu.message_tone = true; err = odict_alloc(&menu.ovaufile, 8); if (err) return err; @@ -1180,6 +1183,7 @@ static int module_init(void) conf_get_bool(conf_cur(), "ringback_disabled", &menu.ringback_disabled); conf_get_bool(conf_cur(), "menu_clean_number", &menu.clean_number); + conf_get_bool(conf_cur(), "menu_message_tone", &menu.message_tone); if (0 == conf_get(conf_cur(), "redial_attempts", &val) && 0 == pl_strcasecmp(&val, "inf")) { diff --git a/modules/menu/menu.h b/modules/menu/menu.h index 20b43b178..d4c83bdcd 100644 --- a/modules/menu/menu.h +++ b/modules/menu/menu.h @@ -37,6 +37,7 @@ struct menu{ struct tmr tmr_play; /**< Tones play timer */ size_t outcnt; /**< Outgoing call counter */ bool dnd; /**< Do not disturb flag */ + bool message_tone; /**< Play tone for SIP MESSAGE */ }; /*Get menu object*/ diff --git a/src/config.c b/src/config.c index 84583b371..a3fb39447 100644 --- a/src/config.c +++ b/src/config.c @@ -1339,6 +1339,7 @@ int config_write_template(const char *file, const struct config *cfg) "#menu_max_earlyaudio\t32\n" "#menu_max_earlyvideo_rx\t32\n" "#menu_max_earlyvideo_tx\t32\n" + "#menu_message_tone\tyes\n" ); (void)re_fprintf(f,