Resolve issues in ConfBridge regarding marked, waitmarked, and unmarked users
Thank's to Neil Tallim (flan)'s tireless testing, issue reporting, and patches
it became clear that app_confbridge had some complex logic in how it handled
interactions between marked, waitmarked, and unmarked users. In particular,
there were some areas in which the interactions between the users resulted
in inconsistent behavior, and app_confbridge was missing logic in how to handle
some corner cases. Some areas included:
* Poor handling of mixing unmarked and waitmarked users
* Inconsistencies in how MOH and muting was applied to various users
* Handling of various announcements for different user profile options
flan's patches seem to fix the various issues, but highlighted how hard the
code could be to maintain. In an attempt to make things easier to maintain and
to more fully enumerate the various cases that exist, this patch breaks up the
logic into a state machine-like setup.
Please note that the various state transitioned are documented on the Asterisk
wiki:
https://wiki.asterisk.org/wiki/display/AST/Confbridge+state+changes
Review: //https://reviewboard.asterisk.org/r/2072/
Note that for the following issues, mjordan uploaded the patch, although it
was written by twilson. Any contributor license discrepency is due to that.
(closes issue ASTERISK-19562)
Reported by: flan
Tested by: flan, mjordan, jrose
patches:
bugASTERISK-19562_ASTERISK-19726_ASTERISK-20181.patch uploaded by twilson (license 6283)
(closes issue ASTERISK-19726)
Reported by: flan
Tested by: flan
patches:
bugASTERISK-19562_ASTERISK-19726_ASTERISK-20181.patch uploaded by twilson (license 6283)
(closes issue ASTERISK-20181)
Reported by: Jonathan White
Tested by: Jonathan White
patches:
bugASTERISK-19562_ASTERISK-19726_ASTERISK-20181.patch uploaded by twilson (license 6283)
........
Merged revisions 374652 from http://svn.asterisk.org/svn/asterisk/branches/10
........
Merged revisions 374657 from http://svn.asterisk.org/svn/asterisk/branches/11
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374658 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-08 18:48:34 +00:00
|
|
|
/*
|
|
|
|
* 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 for the EMPTY state
|
|
|
|
*
|
|
|
|
* \author\verbatim Terry Wilson <twilson@digium.com> \endverbatim
|
|
|
|
*
|
|
|
|
* \ingroup applications
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*** MODULEINFO
|
|
|
|
<support_level>core</support_level>
|
|
|
|
***/
|
|
|
|
|
|
|
|
#include "asterisk.h"
|
|
|
|
#include "asterisk/devicestate.h"
|
|
|
|
#include "include/confbridge.h"
|
|
|
|
#include "include/conf_state.h"
|
|
|
|
|
|
|
|
static void join_unmarked(struct conference_bridge_user *cbu);
|
|
|
|
static void join_waitmarked(struct conference_bridge_user *cbu);
|
|
|
|
static void join_marked(struct conference_bridge_user *cbu);
|
|
|
|
static void transition_to_empty(struct conference_bridge_user *cbu);
|
|
|
|
|
|
|
|
struct conference_state STATE_EMPTY = {
|
|
|
|
.name = "EMPTY",
|
|
|
|
.join_unmarked = join_unmarked,
|
|
|
|
.join_waitmarked = join_waitmarked,
|
|
|
|
.join_marked = join_marked,
|
|
|
|
.entry = transition_to_empty,
|
|
|
|
};
|
|
|
|
|
|
|
|
struct conference_state *CONF_STATE_EMPTY = &STATE_EMPTY;
|
|
|
|
|
|
|
|
static void join_unmarked(struct conference_bridge_user *cbu)
|
|
|
|
{
|
|
|
|
conf_add_user_active(cbu->conference_bridge, cbu);
|
|
|
|
conf_handle_first_join(cbu->conference_bridge);
|
|
|
|
conf_add_post_join_action(cbu, conf_handle_only_unmarked);
|
|
|
|
|
|
|
|
conf_change_state(cbu, CONF_STATE_SINGLE);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void join_waitmarked(struct conference_bridge_user *cbu)
|
|
|
|
{
|
|
|
|
conf_default_join_waitmarked(cbu);
|
|
|
|
conf_handle_first_join(cbu->conference_bridge);
|
|
|
|
|
|
|
|
conf_change_state(cbu, CONF_STATE_INACTIVE);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void join_marked(struct conference_bridge_user *cbu)
|
|
|
|
{
|
|
|
|
conf_add_user_marked(cbu->conference_bridge, cbu);
|
|
|
|
conf_handle_first_join(cbu->conference_bridge);
|
|
|
|
conf_add_post_join_action(cbu, conf_handle_first_marked_common);
|
|
|
|
|
|
|
|
conf_change_state(cbu, CONF_STATE_SINGLE_MARKED);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void transition_to_empty(struct conference_bridge_user *cbu)
|
|
|
|
{
|
|
|
|
/* Set device state to "not in use" */
|
2013-01-02 18:11:59 +00:00
|
|
|
ast_devstate_changed(AST_DEVICE_NOT_INUSE, AST_DEVSTATE_CACHABLE, "confbridge:%s", cbu->conference_bridge->name);
|
Resolve issues in ConfBridge regarding marked, waitmarked, and unmarked users
Thank's to Neil Tallim (flan)'s tireless testing, issue reporting, and patches
it became clear that app_confbridge had some complex logic in how it handled
interactions between marked, waitmarked, and unmarked users. In particular,
there were some areas in which the interactions between the users resulted
in inconsistent behavior, and app_confbridge was missing logic in how to handle
some corner cases. Some areas included:
* Poor handling of mixing unmarked and waitmarked users
* Inconsistencies in how MOH and muting was applied to various users
* Handling of various announcements for different user profile options
flan's patches seem to fix the various issues, but highlighted how hard the
code could be to maintain. In an attempt to make things easier to maintain and
to more fully enumerate the various cases that exist, this patch breaks up the
logic into a state machine-like setup.
Please note that the various state transitioned are documented on the Asterisk
wiki:
https://wiki.asterisk.org/wiki/display/AST/Confbridge+state+changes
Review: //https://reviewboard.asterisk.org/r/2072/
Note that for the following issues, mjordan uploaded the patch, although it
was written by twilson. Any contributor license discrepency is due to that.
(closes issue ASTERISK-19562)
Reported by: flan
Tested by: flan, mjordan, jrose
patches:
bugASTERISK-19562_ASTERISK-19726_ASTERISK-20181.patch uploaded by twilson (license 6283)
(closes issue ASTERISK-19726)
Reported by: flan
Tested by: flan
patches:
bugASTERISK-19562_ASTERISK-19726_ASTERISK-20181.patch uploaded by twilson (license 6283)
(closes issue ASTERISK-20181)
Reported by: Jonathan White
Tested by: Jonathan White
patches:
bugASTERISK-19562_ASTERISK-19726_ASTERISK-20181.patch uploaded by twilson (license 6283)
........
Merged revisions 374652 from http://svn.asterisk.org/svn/asterisk/branches/10
........
Merged revisions 374657 from http://svn.asterisk.org/svn/asterisk/branches/11
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374658 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-08 18:48:34 +00:00
|
|
|
conf_ended(cbu->conference_bridge);
|
|
|
|
}
|