Asterisk - The Open Source Telephony Project  18.5.0
Functions | Variables
conf_state_single.c File Reference

Confbridge state handling for the SINGLE state. More...

#include "include/confbridge.h"
#include "include/conf_state.h"
Include dependency graph for conf_state_single.c:

Go to the source code of this file.

Functions

static void join_marked (struct confbridge_user *user)
 
static void join_unmarked (struct confbridge_user *user)
 
static void leave_unmarked (struct confbridge_user *user)
 
static void transition_to_single (struct confbridge_user *user)
 

Variables

struct confbridge_stateCONF_STATE_SINGLE = &STATE_SINGLE
 Conference state with only a single unmarked active user. More...
 
struct confbridge_state STATE_SINGLE
 

Detailed Description

Confbridge state handling for the SINGLE state.

Author
Terry Wilson <[email protected]> 

Definition in file conf_state_single.c.

Function Documentation

◆ join_marked()

static void join_marked ( struct confbridge_user user)
static

Definition at line 63 of file conf_state_single.c.

References conf_add_user_marked(), conf_change_state(), conf_handle_second_active(), CONF_STATE_MULTI_MARKED, conf_update_user_mute(), and confbridge_user::conference.

64 {
65  conf_add_user_marked(user->conference, user);
68 
70 }
struct confbridge_conference * conference
Definition: confbridge.h:272
void conf_update_user_mute(struct confbridge_user *user)
Update the actual mute status of the user and set it on the bridge.
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.
void conf_handle_second_active(struct confbridge_conference *conference)
Handle when a conference moves to having more than one active participant.
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:82

◆ join_unmarked()

static void join_unmarked ( struct confbridge_user user)
static

Definition at line 54 of file conf_state_single.c.

References conf_add_user_active(), conf_change_state(), conf_handle_second_active(), CONF_STATE_MULTI, conf_update_user_mute(), and confbridge_user::conference.

55 {
56  conf_add_user_active(user->conference, user);
59 
61 }
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.
struct confbridge_state * CONF_STATE_MULTI
Conference state with multiple active users, but no marked users.
struct confbridge_conference * conference
Definition: confbridge.h:272
void conf_update_user_mute(struct confbridge_user *user)
Update the actual mute status of the user and set it on the bridge.
void conf_handle_second_active(struct confbridge_conference *conference)
Handle when a conference moves to having more than one active participant.
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:82

◆ leave_unmarked()

static void leave_unmarked ( struct confbridge_user user)
static

Definition at line 72 of file conf_state_single.c.

References conf_change_state(), conf_moh_stop(), conf_remove_user_active(), CONF_STATE_EMPTY, CONF_STATE_INACTIVE, confbridge_user::conference, confbridge_user::playing_moh, and confbridge_conference::waitingusers.

73 {
75  if (user->playing_moh) {
76  conf_moh_stop(user);
77  }
78 
79  if (user->conference->waitingusers) {
81  } else {
83  }
84 }
void conf_remove_user_active(struct confbridge_conference *conference, struct confbridge_user *user)
Remove a conference bridge user from the unmarked active conference users in the conference.
unsigned int playing_moh
Definition: confbridge.h:283
struct confbridge_conference * conference
Definition: confbridge.h:272
struct confbridge_state * CONF_STATE_EMPTY
Conference state with no active or waiting users.
unsigned int waitingusers
Definition: confbridge.h:251
void conf_moh_stop(struct confbridge_user *user)
Stop MOH for the conference user.
struct confbridge_state * CONF_STATE_INACTIVE
Conference state with only waiting users.
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:82

◆ transition_to_single()

static void transition_to_single ( struct confbridge_user user)
static

Definition at line 86 of file conf_state_single.c.

References conf_mute_only_active(), and confbridge_user::conference.

87 {
89 }
struct confbridge_conference * conference
Definition: confbridge.h:272
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.

Variable Documentation

◆ CONF_STATE_SINGLE

struct confbridge_state* CONF_STATE_SINGLE = &STATE_SINGLE

Conference state with only a single unmarked active user.

Definition at line 52 of file conf_state_single.c.

Referenced by join_unmarked(), leave_marked(), and leave_unmarked().

◆ STATE_SINGLE

struct confbridge_state STATE_SINGLE

Definition at line 43 of file conf_state_single.c.