Asterisk - The Open Source Telephony Project  21.4.1
conf_state_single_marked.c
Go to the documentation of this file.
1 /*
2  * Asterisk -- An open source telephony toolkit.
3  *
4  * Copyright (C) 2012, Terry Wilson
5  *
6  * Terry Wilson <twilson@digium.com>
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 SINGLE_MARKED state
22  *
23  * \author\verbatim Terry Wilson <twilson@digium.com> \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_active(struct confbridge_user *user);
36 static void join_marked(struct confbridge_user *user);
37 static void leave_marked(struct confbridge_user *user);
38 static void transition_to_single_marked(struct confbridge_user *user);
39 
40 struct confbridge_state STATE_SINGLE_MARKED = {
41  .name = "SINGLE_MARKED",
42  .join_unmarked = join_active,
43  .join_waitmarked = join_active,
44  .join_marked = join_marked,
45  .leave_marked = leave_marked,
46  .entry = transition_to_single_marked,
47 };
48 struct confbridge_state *CONF_STATE_SINGLE_MARKED = &STATE_SINGLE_MARKED;
49 
50 static void join_active(struct confbridge_user *user)
51 {
52  conf_add_user_active(user->conference, user);
55 
57 }
58 
59 static void join_marked(struct confbridge_user *user)
60 {
61  conf_add_user_marked(user->conference, user);
64 
66 }
67 
68 static void leave_marked(struct confbridge_user *user)
69 {
71  if (user->playing_moh) {
72  conf_moh_stop(user);
73  }
74 
76 }
77 
78 static void transition_to_single_marked(struct confbridge_user *user)
79 {
81 }
void conf_remove_user_marked(struct confbridge_conference *conference, struct confbridge_user *user)
Remove a conference bridge user from the marked active conference users in the conference.
void conf_add_user_active(struct confbridge_conference *conference, struct confbridge_user *user)
Add a conference bridge user as an unmarked active user of the conference.
unsigned int playing_moh
Definition: confbridge.h:285
struct confbridge_conference * conference
Definition: confbridge.h:274
void conf_mute_only_active(struct confbridge_conference *conference)
Attempt to mute/play MOH to the only user in the conference if they require it.
void conf_update_user_mute(struct confbridge_user *user)
Update the actual mute status of the user and set it on the bridge.
struct confbridge_state * CONF_STATE_EMPTY
Conference state with no active or waiting users.
void conf_add_user_marked(struct confbridge_conference *conference, struct confbridge_user *user)
Add a conference bridge user as a marked active user of the conference.
conference_event_fn join_marked
Definition: conf_state.h:49
struct confbridge_state * CONF_STATE_SINGLE_MARKED
Conference state with only a single marked active user.
void conf_handle_second_active(struct confbridge_conference *conference)
Handle when a conference moves to having more than one active participant.
conference_event_fn leave_marked
Definition: conf_state.h:52
void conf_moh_stop(struct confbridge_user *user)
Stop MOH for the conference user.
structure to hold users read from users.conf
Confbridge state handling.
A conference state object to hold the various state callback functions.
Definition: conf_state.h:45
The structure that represents a conference bridge user.
Definition: confbridge.h:273
struct confbridge_state * CONF_STATE_MULTI_MARKED
Conference state with multiple active users and at least one marked user.
void conf_change_state(struct confbridge_user *user, struct confbridge_state *newstate)
Execute conference state transition because of a user action.
Definition: conf_state.c:77