mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-09 03:18:30 +00:00
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 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@377993 65c4cc65-6c06-0410-ace0-fbb531ad65f3
95 lines
2.8 KiB
C
95 lines
2.8 KiB
C
/*
|
|
* Asterisk -- An open source telephony toolkit.
|
|
*
|
|
* Copyright (C) 2012, Terry Wilson
|
|
*
|
|
* Terry Wilson <twilson@digium.com>
|
|
*
|
|
* See http://www.asterisk.org for more information about
|
|
* the Asterisk project. Please do not directly contact
|
|
* any of the maintainers of this project for assistance;
|
|
* the project provides a web site, mailing lists and IRC
|
|
* channels for your use.
|
|
*
|
|
* This program is free software, distributed under the terms of
|
|
* the GNU General Public License Version 2. See the LICENSE file
|
|
* at the top of the source tree.
|
|
*
|
|
* Please follow coding guidelines
|
|
* http://svn.digium.com/view/asterisk/trunk/doc/CODING-GUIDELINES
|
|
*/
|
|
|
|
/*! \file
|
|
*
|
|
* \brief Confbridge state handling
|
|
*
|
|
* \author\verbatim Terry Wilson <twilson@digium.com> \endverbatim
|
|
*
|
|
* This file contains functions that are used from multiple conf_state
|
|
* files for handling stage change behavior.
|
|
*
|
|
* \ingroup applications
|
|
*/
|
|
|
|
/*** MODULEINFO
|
|
<support_level>core</support_level>
|
|
***/
|
|
|
|
#include "asterisk.h"
|
|
|
|
#include "asterisk/logger.h"
|
|
#include "asterisk/test.h"
|
|
#include "include/conf_state.h"
|
|
#include "include/confbridge.h"
|
|
|
|
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);
|
|
}
|
|
|
|
void conf_default_leave_waitmarked(struct conference_bridge_user *cbu)
|
|
{
|
|
conf_remove_user_waiting(cbu->conference_bridge, cbu);
|
|
}
|
|
|
|
void conf_change_state(struct conference_bridge_user *cbu, struct conference_state *newstate)
|
|
{
|
|
ast_debug(1, "Changing conference '%s' state from %s to %s\n", cbu->conference_bridge->name, cbu->conference_bridge->state->name, newstate->name);
|
|
ast_test_suite_event_notify("CONF_CHANGE_STATE", "Conference: %s\r\nOldState: %s\r\nNewState: %s\r\n",
|
|
cbu->conference_bridge->name,
|
|
cbu->conference_bridge->state->name,
|
|
newstate->name);
|
|
if (cbu->conference_bridge->state->exit) {
|
|
cbu->conference_bridge->state->exit(cbu);
|
|
}
|
|
cbu->conference_bridge->state = newstate;
|
|
if (cbu->conference_bridge->state->entry) {
|
|
cbu->conference_bridge->state->entry(cbu);
|
|
}
|
|
}
|