apps/confbridge: Added hear_own_join_sound option to control who hears sound_join

Added the hear_own_join_sound option to the confbridge user profile to
control who hears the sound_join audio file. When set to 'yes' the user
entering the conference and the participants already in the conference
will hear the sound_join audio file. When set to 'no' the user entering
the conference will not hear the sound_join audio file, but the
participants already in the conference will hear the sound_join audio
file.

ASTERISK-29931
Added by Michael Cargile

Change-Id: I856bd66dc0dfa057323860a6418c1371d249abd2
This commit is contained in:
Michael Cargile
2022-02-23 11:29:09 -05:00
committed by Kevin Harwell
parent 19c841950b
commit a2679b0ee2
5 changed files with 34 additions and 5 deletions

View File

@@ -2725,17 +2725,24 @@ static int confbridge_exec(struct ast_channel *chan, const char *data)
ast_autoservice_stop(chan);
}
/* Play the Join sound to both the conference and the user entering. */
if (!quiet) {
const char *join_sound = conf_get_sound(CONF_SOUND_JOIN, conference->b_profile.sounds);
if (strcmp(conference->b_profile.language, ast_channel_language(chan))) {
ast_stream_and_wait(chan, join_sound, "");
/* if hear_own_join_sound is enabled play the Join sound to everyone */
if (ast_test_flag(&user.u_profile, USER_OPT_HEAR_OWN_JOIN_SOUND) ) {
if (strcmp(conference->b_profile.language, ast_channel_language(chan))) {
ast_stream_and_wait(chan, join_sound, "");
ast_autoservice_start(chan);
play_sound_file(conference, join_sound);
ast_autoservice_stop(chan);
} else {
async_play_sound_file(conference, join_sound, chan);
}
/* if hear_own_join_sound is disabled only play the Join sound to just the conference */
} else {
ast_autoservice_start(chan);
play_sound_file(conference, join_sound);
ast_autoservice_stop(chan);
} else {
async_play_sound_file(conference, join_sound, chan);
}
}