conf_state_inactive.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 INACTIVE 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_waitmarked(struct confbridge_user *user);
00041 
00042 struct confbridge_state STATE_INACTIVE = {
00043    .name = "INACTIVE",
00044    .join_unmarked = join_unmarked,
00045    .join_waitmarked = conf_default_join_waitmarked,
00046    .join_marked = join_marked,
00047    .leave_waitmarked = leave_waitmarked,
00048 };
00049 struct confbridge_state *CONF_STATE_INACTIVE = &STATE_INACTIVE;
00050 
00051 static void join_unmarked(struct confbridge_user *user)
00052 {
00053    conf_add_user_active(user->conference, user);
00054    conf_add_post_join_action(user, conf_handle_only_unmarked);
00055 
00056    conf_change_state(user, CONF_STATE_SINGLE);
00057 }
00058 
00059 static void join_marked(struct confbridge_user *user)
00060 {
00061    conf_add_user_marked(user->conference, user);
00062    conf_update_user_mute(user);
00063 
00064    conf_change_state(user, CONF_STATE_MULTI_MARKED);
00065 }
00066 
00067 static void leave_waitmarked(struct confbridge_user *user)
00068 {
00069    conf_default_leave_waitmarked(user);
00070    if (user->conference->waitingusers == 0) {
00071       conf_change_state(user, CONF_STATE_EMPTY);
00072    }
00073 }

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