app_confbridge: Only use b_profile options from the conference.

A user cannot set new bridge options after the conference is created by
the first user.  Attempting to do so is documented as undefined behavior.

This patch ensures that the bridge profile options used are from the
conference and not what a subsequent user may have tried to set.

Change-Id: I1b6383eba654679e5739d5a8de98199cf074a266
This commit is contained in:
Richard Mudgett
2016-01-25 17:36:50 -06:00
parent fc0527eb4f
commit 1bc54aee80
2 changed files with 40 additions and 35 deletions

View File

@@ -163,7 +163,7 @@ static void leave_marked(struct confbridge_user *user)
ao2_unlock(user->conference);
ast_autoservice_start(user->chan);
play_sound_file(user->conference,
conf_get_sound(CONF_SOUND_LEADER_HAS_LEFT, user->b_profile.sounds));
conf_get_sound(CONF_SOUND_LEADER_HAS_LEFT, user->conference->b_profile.sounds));
ast_autoservice_stop(user->chan);
ao2_lock(user->conference);
}
@@ -182,14 +182,14 @@ static void leave_marked(struct confbridge_user *user)
}
}
static int post_join_play_begin(struct confbridge_user *cbu)
static int post_join_play_begin(struct confbridge_user *user)
{
int res;
ast_autoservice_start(cbu->chan);
res = play_sound_file(cbu->conference,
conf_get_sound(CONF_SOUND_BEGIN, cbu->b_profile.sounds));
ast_autoservice_stop(cbu->chan);
ast_autoservice_start(user->chan);
res = play_sound_file(user->conference,
conf_get_sound(CONF_SOUND_BEGIN, user->conference->b_profile.sounds));
ast_autoservice_stop(user->chan);
return res;
}