Asterisk - The Open Source Telephony Project GIT-master-f36a736
Data Structures | Typedefs | Functions | Variables
conf_state.h File Reference

Confbridge state handling. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  confbridge_state
 A conference state object to hold the various state callback functions. More...
 

Typedefs

typedef void(* conference_entry_fn) (struct confbridge_user *user)
 
typedef void(* conference_event_fn) (struct confbridge_user *user)
 
typedef void(* conference_exit_fn) (struct confbridge_user *user)
 

Functions

void conf_change_state (struct confbridge_user *user, struct confbridge_state *newstate)
 Execute conference state transition because of a user action. More...
 
void conf_default_join_waitmarked (struct confbridge_user *user)
 Logic to execute every time a waitmarked user joins an unmarked conference. More...
 
void conf_default_leave_waitmarked (struct confbridge_user *user)
 Logic to execute every time a waitmarked user leaves an unmarked conference. More...
 
void conf_invalid_event_fn (struct confbridge_user *user)
 A handler for join/leave events that are invalid in a particular state. More...
 

Variables

struct confbridge_stateCONF_STATE_EMPTY
 Conference state with no active or waiting users. More...
 
struct confbridge_stateCONF_STATE_INACTIVE
 Conference state with only waiting users. More...
 
struct confbridge_stateCONF_STATE_MULTI
 Conference state with multiple active users, but no marked users. More...
 
struct confbridge_stateCONF_STATE_MULTI_MARKED
 Conference state with multiple active users and at least one marked user. More...
 
struct confbridge_stateCONF_STATE_SINGLE
 Conference state with only a single unmarked active user. More...
 
struct confbridge_stateCONF_STATE_SINGLE_MARKED
 Conference state with only a single marked active user. More...
 

Detailed Description

Confbridge state handling.

Author
Terry Wilson <twilson@digium.com> 

See https://docs.asterisk.org/Development/Reference-Information/Other-Reference-Information/Confbridge-state-changes/ for a more complete description of how conference states work.

Definition in file conf_state.h.

Typedef Documentation

◆ conference_entry_fn

typedef void(* conference_entry_fn) (struct confbridge_user *user)

Definition at line 41 of file conf_state.h.

◆ conference_event_fn

typedef void(* conference_event_fn) (struct confbridge_user *user)

Definition at line 40 of file conf_state.h.

◆ conference_exit_fn

typedef void(* conference_exit_fn) (struct confbridge_user *user)

Definition at line 42 of file conf_state.h.

Function Documentation

◆ conf_change_state()

void conf_change_state ( struct confbridge_user user,
struct confbridge_state newstate 
)

Execute conference state transition because of a user action.

Parameters
userThe user that joined/left
newstateThe state to transition to

Definition at line 77 of file conf_state.c.

78{
79 ast_debug(1, "Changing conference '%s' state from %s to %s\n", user->conference->name, user->conference->state->name, newstate->name);
80 ast_test_suite_event_notify("CONF_CHANGE_STATE", "Conference: %s\r\nOldState: %s\r\nNewState: %s\r\n",
81 user->conference->name,
82 user->conference->state->name,
83 newstate->name);
84 if (user->conference->state->exit) {
85 user->conference->state->exit(user);
86 }
87 user->conference->state = newstate;
88 if (user->conference->state->entry) {
89 user->conference->state->entry(user);
90 }
91}
#define ast_debug(level,...)
Log a DEBUG message.
const char * name
Definition: conf_state.h:46
structure to hold users read from users.conf
#define ast_test_suite_event_notify(s, f,...)
Definition: test.h:189

References ast_debug, ast_test_suite_event_notify, and confbridge_state::name.

Referenced by join_active(), join_marked(), join_unmarked(), join_waitmarked(), leave_active(), leave_marked(), leave_unmarked(), and leave_waitmarked().

◆ conf_default_join_waitmarked()

void conf_default_join_waitmarked ( struct confbridge_user user)

Logic to execute every time a waitmarked user joins an unmarked conference.

Definition at line 62 of file conf_state.c.

63{
64 conf_add_user_waiting(user->conference, user);
67}
int conf_handle_inactive_waitmarked(struct confbridge_user *user)
Handle actions every time a waitmarked user joins w/o a marked user present.
void conf_add_user_waiting(struct confbridge_conference *conference, struct confbridge_user *user)
Add a conference bridge user as an waiting user of the conference.
int conf_add_post_join_action(struct confbridge_user *user, int(*func)(struct confbridge_user *user))
Queue a function to run with the given conference bridge user as an argument once the state transitio...
static void conf_mute_moh_inactive_waitmarked(struct confbridge_user *user)
Definition: conf_state.c:53

References conf_add_post_join_action(), conf_add_user_waiting(), conf_handle_inactive_waitmarked(), and conf_mute_moh_inactive_waitmarked().

Referenced by join_waitmarked().

◆ conf_default_leave_waitmarked()

void conf_default_leave_waitmarked ( struct confbridge_user user)

Logic to execute every time a waitmarked user leaves an unmarked conference.

Definition at line 69 of file conf_state.c.

70{
72 if (user->playing_moh) {
74 }
75}
void conf_moh_stop(struct confbridge_user *user)
Stop MOH for the conference user.
void conf_remove_user_waiting(struct confbridge_conference *conference, struct confbridge_user *user)
Remove a conference bridge user from the waiting conference users in the conference.

References conf_moh_stop(), and conf_remove_user_waiting().

Referenced by leave_waitmarked().

◆ conf_invalid_event_fn()

void conf_invalid_event_fn ( struct confbridge_user user)

A handler for join/leave events that are invalid in a particular state.

Definition at line 42 of file conf_state.c.

43{
44 ast_log(LOG_ERROR, "Invalid event for confbridge user '%s'\n", user->u_profile.name);
45}
#define ast_log
Definition: astobj2.c:42
#define LOG_ERROR

References ast_log, and LOG_ERROR.

Referenced by handle_conf_user_join(), and handle_conf_user_leave().

Variable Documentation

◆ CONF_STATE_EMPTY

struct confbridge_state* CONF_STATE_EMPTY
extern

Conference state with no active or waiting users.

Definition at line 50 of file conf_state_empty.c.

Referenced by join_conference_bridge(), leave_marked(), leave_unmarked(), and leave_waitmarked().

◆ CONF_STATE_INACTIVE

struct confbridge_state* CONF_STATE_INACTIVE
extern

Conference state with only waiting users.

Definition at line 46 of file conf_state_inactive.c.

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

◆ CONF_STATE_MULTI

struct confbridge_state* CONF_STATE_MULTI
extern

Conference state with multiple active users, but no marked users.

Definition at line 47 of file conf_state_multi.c.

Referenced by join_unmarked(), and leave_marked().

◆ CONF_STATE_MULTI_MARKED

struct confbridge_state* CONF_STATE_MULTI_MARKED
extern

Conference state with multiple active users and at least one marked user.

Definition at line 56 of file conf_state_multi_marked.c.

Referenced by join_active(), and join_marked().

◆ CONF_STATE_SINGLE

struct confbridge_state* CONF_STATE_SINGLE
extern

Conference state with only a single unmarked active user.

Definition at line 49 of file conf_state_single.c.

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

◆ CONF_STATE_SINGLE_MARKED

struct confbridge_state* CONF_STATE_SINGLE_MARKED
extern

Conference state with only a single marked active user.

Definition at line 48 of file conf_state_single_marked.c.

Referenced by join_marked(), leave_active(), and leave_marked().