Asterisk - The Open Source Telephony Project GIT-master-a358458
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 <twilson@digium.com> 

Definition in file conf_state_empty.c.

Function Documentation

◆ join_marked()

static void join_marked ( struct confbridge_user user)
static

Definition at line 69 of file conf_state_empty.c.

70{
71 conf_add_user_marked(user->conference, user);
72 conf_handle_first_join(user->conference);
74
76}
int conf_handle_only_person(struct confbridge_user *user)
Handle actions whenever an user joins an empty conference.
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.
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...
void conf_handle_first_join(struct confbridge_conference *conference)
Callback to execute any time we transition from zero to one active 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:77
struct confbridge_state * CONF_STATE_SINGLE_MARKED
Conference state with only a single marked active user.
structure to hold users read from users.conf

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

◆ join_unmarked()

static void join_unmarked ( struct confbridge_user user)
static

Definition at line 52 of file conf_state_empty.c.

53{
54 conf_add_user_active(user->conference, user);
55 conf_handle_first_join(user->conference);
57
59}
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_SINGLE
Conference state with only a single unmarked active user.

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

◆ join_waitmarked()

static void join_waitmarked ( struct confbridge_user user)
static

Definition at line 61 of file conf_state_empty.c.

62{
64 conf_handle_first_join(user->conference);
65
67}
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:62
struct confbridge_state * CONF_STATE_INACTIVE
Conference state with only waiting users.

References conf_change_state(), conf_default_join_waitmarked(), conf_handle_first_join(), and CONF_STATE_INACTIVE.

◆ transition_to_empty()

static void transition_to_empty ( struct confbridge_user user)
static

Definition at line 78 of file conf_state_empty.c.

79{
80 /* Set device state to "not in use" */
81 ast_devstate_changed(AST_DEVICE_NOT_INUSE, AST_DEVSTATE_CACHABLE, "confbridge:%s", user->conference->name);
82 conf_ended(user->conference);
83}
void conf_ended(struct confbridge_conference *conference)
Callback to be called when the conference has become empty.
@ AST_DEVSTATE_CACHABLE
Definition: devicestate.h:70
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
@ AST_DEVICE_NOT_INUSE
Definition: devicestate.h:54

References AST_DEVICE_NOT_INUSE, AST_DEVSTATE_CACHABLE, ast_devstate_changed(), and conf_ended().

Variable Documentation

◆ CONF_STATE_EMPTY

struct confbridge_state* CONF_STATE_EMPTY = &STATE_EMPTY

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().

◆ STATE_EMPTY

struct confbridge_state STATE_EMPTY

Definition at line 42 of file conf_state_empty.c.