conf_state_single_marked.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 SINGLE_MARKED 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_active(struct confbridge_user *user);
00039 static void join_marked(struct confbridge_user *user);
00040 static void leave_marked(struct confbridge_user *user);
00041 static void transition_to_single_marked(struct confbridge_user *user);
00042 
00043 struct confbridge_state STATE_SINGLE_MARKED = {
00044    .name = "SINGLE_MARKED",
00045    .join_unmarked = join_active,
00046    .join_waitmarked = join_active,
00047    .join_marked = join_marked,
00048    .leave_marked = leave_marked,
00049    .entry = transition_to_single_marked,
00050 };
00051 struct confbridge_state *CONF_STATE_SINGLE_MARKED = &STATE_SINGLE_MARKED;
00052 
00053 static void join_active(struct confbridge_user *user)
00054 {
00055    conf_add_user_active(user->conference, user);
00056    conf_handle_second_active(user->conference);
00057    conf_update_user_mute(user);
00058 
00059    conf_change_state(user, CONF_STATE_MULTI_MARKED);
00060 }
00061 
00062 static void join_marked(struct confbridge_user *user)
00063 {
00064    conf_add_user_marked(user->conference, user);
00065    conf_handle_second_active(user->conference);
00066    conf_update_user_mute(user);
00067 
00068    conf_change_state(user, CONF_STATE_MULTI_MARKED);
00069 }
00070 
00071 static void leave_marked(struct confbridge_user *user)
00072 {
00073    conf_remove_user_marked(user->conference, user);
00074    if (user->playing_moh) {
00075       conf_moh_stop(user);
00076    }
00077 
00078    conf_change_state(user, CONF_STATE_EMPTY);
00079 }
00080 
00081 static void transition_to_single_marked(struct confbridge_user *user)
00082 {
00083    conf_mute_only_active(user->conference);
00084 }

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