Debian Codegraph @

apps/confbridge/conf_state_inactive.c

raw symbols SCIP
1 /*
2 * Asterisk -- An open source telephony toolkit.
3 *
4 * Copyright (C) 2012, Terry Wilson
5 *
6 * Terry Wilson <[email protected]>
7 *
8 * See http://www.asterisk.org for more information about
9 * the Asterisk project. Please do not directly contact
10 * any of the maintainers of this project for assistance;
11 * the project provides a web site, mailing lists and IRC
12 * channels for your use.
13 *
14 * This program is free software, distributed under the terms of
15 * the GNU General Public License Version 2. See the LICENSE file
16 * at the top of the source tree.
17 */
18
19 /*! \file
20 *
21 * \brief Confbridge state handling for the INACTIVE state
22 *
23 * \author\verbatim Terry Wilson <[email protected]> \endverbatim
24 *
25 * \ingroup applications
26 */
27
28 /*** MODULEINFO
29 <support_level>core</support_level>
30 ***/
31
32 #include "include/confbridge.h"
33 #include "include/conf_state.h"
34
35 static void join_unmarked(struct confbridge_user *user);
36 static void join_marked(struct confbridge_user *user);
37 static void leave_waitmarked(struct confbridge_user *user);
38
39 struct confbridge_state STATE_INACTIVE = {
40 .name = "INACTIVE",
41 .join_unmarked = join_unmarked,
42 .join_waitmarked = conf_default_join_waitmarked,
43 .join_marked = join_marked,
44 .leave_waitmarked = leave_waitmarked,
45 };
46 struct confbridge_state *CONF_STATE_INACTIVE = &STATE_INACTIVE;
47
48 static void join_unmarked(struct confbridge_user *user)
49 {
50 conf_add_user_active(user->conference, user);
51 conf_add_post_join_action(user, conf_handle_only_person);
52
53 conf_change_state(user, CONF_STATE_SINGLE);
54 }
55
56 static void join_marked(struct confbridge_user *user)
57 {
58 conf_add_user_marked(user->conference, user);
59 conf_update_user_mute(user);
60
61 conf_change_state(user, CONF_STATE_MULTI_MARKED);
62 }
63
64 static void leave_waitmarked(struct confbridge_user *user)
65 {
66 conf_default_leave_waitmarked(user);
67 if (user->conference->waitingusers == 0) {
68 conf_change_state(user, CONF_STATE_EMPTY);
69 }
70 }