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

Confbridge state handling for the EMPTY state. More...

#include "asterisk.h"
#include "asterisk/devicestate.h"
#include "include/confbridge.h"
#include "include/conf_state.h"
Include dependency graph for conf_state_empty.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 join_waitmarked (struct confbridge_user *user)
 
static void transition_to_empty (struct confbridge_user *user)
 

Variables

struct confbridge_stateCONF_STATE_EMPTY = &STATE_EMPTY
 Conference state with no active or waiting users. More...
 
struct confbridge_state STATE_EMPTY
 

Detailed Description

Confbridge state handling for the EMPTY state.

Author
Terry Wilson <[email protected]> 

Definition in file conf_state_empty.c.

Function Documentation

◆ join_marked()

static void join_marked ( struct confbridge_user user)
static

Definition at line 72 of file conf_state_empty.c.

References conf_add_post_join_action(), conf_add_user_marked(), conf_change_state(), conf_handle_first_join(), conf_handle_only_person(), CONF_STATE_SINGLE_MARKED, and confbridge_user::conference.

73 {
74  conf_add_user_marked(user->conference, user);
77 
79 }
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...
struct confbridge_conference * conference
Definition: confbridge.h:272
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.
struct confbridge_state * CONF_STATE_SINGLE_MARKED
Conference state with only a single marked active user.
void conf_handle_first_join(struct confbridge_conference *conference)
Callback to execute any time we transition from zero to one active users.
int conf_handle_only_person(struct confbridge_user *user)
Handle actions whenever an user joins an empty conference.
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 55 of file conf_state_empty.c.

References conf_add_post_join_action(), conf_add_user_active(), conf_change_state(), conf_handle_first_join(), conf_handle_only_person(), CONF_STATE_SINGLE, and confbridge_user::conference.

56 {
57  conf_add_user_active(user->conference, user);
60 
62 }
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.
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...
struct confbridge_conference * conference
Definition: confbridge.h:272
void conf_handle_first_join(struct confbridge_conference *conference)
Callback to execute any time we transition from zero to one active users.
int conf_handle_only_person(struct confbridge_user *user)
Handle actions whenever an user joins an empty conference.
struct confbridge_state * CONF_STATE_SINGLE
Conference state with only a single unmarked active 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_waitmarked()

static void join_waitmarked ( struct confbridge_user user)
static

Definition at line 64 of file conf_state_empty.c.

References conf_change_state(), conf_default_join_waitmarked(), conf_handle_first_join(), CONF_STATE_INACTIVE, and confbridge_user::conference.

65 {
68 
70 }
struct confbridge_conference * conference
Definition: confbridge.h:272
void conf_handle_first_join(struct confbridge_conference *conference)
Callback to execute any time we transition from zero to one active users.
void conf_default_join_waitmarked(struct confbridge_user *user)
Logic to execute every time a waitmarked user joins an unmarked conference.
Definition: conf_state.c:67
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_empty()

static void transition_to_empty ( struct confbridge_user user)
static

Definition at line 81 of file conf_state_empty.c.

References AST_DEVICE_NOT_INUSE, AST_DEVSTATE_CACHABLE, ast_devstate_changed(), conf_ended(), confbridge_user::conference, and confbridge_conference::name.

82 {
83  /* Set device state to "not in use" */
85  conf_ended(user->conference);
86 }
struct confbridge_conference * conference
Definition: confbridge.h:272
int ast_devstate_changed(enum ast_device_state state, enum ast_devstate_cache cachable, const char *fmt,...)
Tells Asterisk the State for Device is changed.
Definition: devicestate.c:510
void conf_ended(struct confbridge_conference *conference)
Callback to be called when the conference has become empty.
char name[MAX_CONF_NAME]
Definition: confbridge.h:245

Variable Documentation

◆ CONF_STATE_EMPTY

struct confbridge_state* CONF_STATE_EMPTY = &STATE_EMPTY

Conference state with no active or waiting users.

Definition at line 53 of file conf_state_empty.c.

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

◆ STATE_EMPTY

struct confbridge_state STATE_EMPTY

Definition at line 45 of file conf_state_empty.c.