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

Confbridge state handling. More...

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.
 
void conf_default_leave_waitmarked (struct confbridge_user *user)
 Logic to execute every time a waitmarked user leaves an unmarked conference.
 
void conf_invalid_event_fn (struct confbridge_user *user)
 A handler for join/leave events that are invalid in a particular state.
 

Variables

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

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.

Function Documentation

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.

References ast_debug, ast_test_suite_event_notify, confbridge_user::conference, confbridge_state::entry, confbridge_state::exit, confbridge_conference::name, and confbridge_conference::state.

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 }
struct confbridge_conference * conference
Definition: confbridge.h:274
#define ast_debug(level,...)
Log a DEBUG message.
conference_entry_fn entry
Definition: conf_state.h:53
struct confbridge_state * state
Definition: confbridge.h:248
#define ast_test_suite_event_notify(s, f,...)
Definition: test.h:189
char name[MAX_CONF_NAME]
Definition: confbridge.h:247
conference_exit_fn exit
Definition: conf_state.h:54