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
This commit is contained in:
Richard Mudgett
2012-12-13 21:28:15 +00:00
parent 5cf8a1f2e5
commit b17f7cab95
5 changed files with 172 additions and 49 deletions

View File

@@ -47,9 +47,28 @@ void conf_invalid_event_fn(struct conference_bridge_user *cbu)
ast_log(LOG_ERROR, "Invalid event for confbridge user '%s'\n", cbu->u_profile.name);
}
/*!
* \internal
* \brief Mute the user and play MOH if the user requires it.
*
* \param user Conference user to mute and optionally start MOH on.
*
* \return Nothing
*/
static void conf_mute_moh_inactive_waitmarked(struct conference_bridge_user *user)
{
/* Be sure we are muted so we can't talk to anybody else waiting */
user->features.mute = 1;
/* Start music on hold if needed */
if (ast_test_flag(&user->u_profile, USER_OPT_MUSICONHOLD)) {
conf_moh_start(user);
}
}
void conf_default_join_waitmarked(struct conference_bridge_user *cbu)
{
conf_add_user_waiting(cbu->conference_bridge, cbu);
conf_mute_moh_inactive_waitmarked(cbu);
conf_add_post_join_action(cbu, conf_handle_inactive_waitmarked);
}