summaryrefslogtreecommitdiff
path: root/apps/confbridge/conf_state_multi_marked.c
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2012-12-13 21:28:15 +0000
committerRichard Mudgett <rmudgett@digium.com>2012-12-13 21:28:15 +0000
commitb17f7cab952f61ce35bc62d227103ca6e8a94980 (patch)
tree73841c6f56ea5fac5c3f519238ef1d6c7167218d /apps/confbridge/conf_state_multi_marked.c
parent5cf8a1f2e502f4b50bc0f2a8f955798ba3e73275 (diff)
confbridge: Fix MOH on simultaneous user entry to a new conference.
When two users entered a new conference simultaneously, one of the callers hears MOH. This happened if two unmarked users entered simultaneously and also if a waitmarked and a marked user entered simultaneously. * Created a confbridge internal MOH API to eliminate the inlined MOH handling code. Note that the conference mixing bridge needs to be locked when actually starting/stopping MOH because there is a small window between the conference join unsuspend MOH and actually joining the mixing bridge. * Created the concept of suspended MOH so it can be interrupted while conference join announcements to the user and DTMF features can operate. * Suspend any MOH until the user is about to actually join the mixing bridge of the conference. This way any pre-join file playback does not need to worry about MOH. * Made post-join actions only play deferred entry announcement files. Changing the user/conference state during that time is not protected or controlled by the state machine. (closes issue ASTERISK-20606) Reported by: Eugenia Belova Tested by: rmudgett Review: https://reviewboard.asterisk.org/r/2232/ ........ Merged revisions 377992 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 377993 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378002 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/confbridge/conf_state_multi_marked.c')
-rw-r--r--apps/confbridge/conf_state_multi_marked.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/apps/confbridge/conf_state_multi_marked.c b/apps/confbridge/conf_state_multi_marked.c
index 69850b18d..252926609 100644
--- a/apps/confbridge/conf_state_multi_marked.c
+++ b/apps/confbridge/conf_state_multi_marked.c
@@ -107,12 +107,8 @@ static void leave_marked(struct conference_bridge_user *cbu)
cbu_iter->conference_bridge->waitingusers++;
/* Handle muting/moh of cbu_iter if necessary */
if (ast_test_flag(&cbu_iter->u_profile, USER_OPT_MUSICONHOLD)) {
- cbu_iter->features.mute = 1;
- if (!ast_bridge_suspend(cbu_iter->conference_bridge->bridge, cbu_iter->chan)) {
- ast_moh_start(cbu_iter->chan, cbu_iter->u_profile.moh_class, NULL);
- cbu_iter->playing_moh = 1;
- ast_bridge_unsuspend(cbu_iter->conference_bridge->bridge, cbu_iter->chan);
- }
+ cbu_iter->features.mute = 1;
+ conf_moh_start(cbu_iter);
}
}
}
@@ -173,10 +169,8 @@ static void transition_to_marked(struct conference_bridge_user *cbu)
cbu->conference_bridge->waitingusers--;
AST_LIST_INSERT_TAIL(&cbu->conference_bridge->active_list, cbu_iter, list);
cbu->conference_bridge->activeusers++;
- if (cbu_iter->playing_moh && !ast_bridge_suspend(cbu->conference_bridge->bridge, cbu_iter->chan)) {
- cbu_iter->playing_moh = 0;
- ast_moh_stop(cbu_iter->chan);
- ast_bridge_unsuspend(cbu->conference_bridge->bridge, cbu_iter->chan);
+ if (cbu_iter->playing_moh) {
+ conf_moh_stop(cbu_iter);
}
/* only unmute them if they are not supposed to start muted */
if (!ast_test_flag(&cbu_iter->u_profile, USER_OPT_STARTMUTED)) {