conf_state_multi.c

Go to the documentation of this file.
00001 /*
00002  * Asterisk -- An open source telephony toolkit.
00003  *
00004  * Copyright (C) 2012, Terry Wilson
00005  *
00006  * Terry Wilson <twilson@digium.com>
00007  *
00008  * See http://www.asterisk.org for more information about
00009  * the Asterisk project. Please do not directly contact
00010  * any of the maintainers of this project for assistance;
00011  * the project provides a web site, mailing lists and IRC
00012  * channels for your use.
00013  *
00014  * This program is free software, distributed under the terms of
00015  * the GNU General Public License Version 2. See the LICENSE file
00016  * at the top of the source tree.
00017  *
00018  * Please follow coding guidelines
00019  * http://svn.digium.com/view/asterisk/trunk/doc/CODING-GUIDELINES
00020  */
00021 
00022 /*! \file
00023  *
00024  * \brief Confbridge state handling for the MULTI state
00025  *
00026  * \author\verbatim Terry Wilson <twilson@digium.com> \endverbatim
00027  *
00028  * \ingroup applications
00029  */
00030 
00031 /*** MODULEINFO
00032    <support_level>core</support_level>
00033  ***/
00034 
00035 #include "include/confbridge.h"
00036 #include "include/conf_state.h"
00037 
00038 static void join_unmarked(struct confbridge_user *user);
00039 static void join_marked(struct confbridge_user *user);
00040 static void leave_unmarked(struct confbridge_user *user);
00041 
00042 struct confbridge_state STATE_MULTI = {
00043    .name = "MULTI",
00044    .join_unmarked = join_unmarked,
00045    .join_waitmarked = conf_default_join_waitmarked,
00046    .join_marked = join_marked,
00047    .leave_unmarked = leave_unmarked,
00048    .leave_waitmarked = conf_default_leave_waitmarked,
00049 };
00050 struct confbridge_state *CONF_STATE_MULTI = &STATE_MULTI;
00051 
00052 static void join_unmarked(struct confbridge_user *user)
00053 {
00054    conf_add_user_active(user->conference, user);
00055    conf_update_user_mute(user);
00056 }
00057 
00058 static void join_marked(struct confbridge_user *user)
00059 {
00060    conf_add_user_marked(user->conference, user);
00061    conf_update_user_mute(user);
00062 
00063    conf_change_state(user, CONF_STATE_MULTI_MARKED);
00064 }
00065 
00066 static void leave_unmarked(struct confbridge_user *user)
00067 {
00068    conf_remove_user_active(user->conference, user);
00069    if (user->conference->activeusers == 1) {
00070       conf_change_state(user, CONF_STATE_SINGLE);
00071    }
00072 }

Generated on Thu Apr 16 06:27:31 2015 for Asterisk - The Open Source Telephony Project by  doxygen 1.5.6