Asterisk - The Open Source Telephony Project  GIT-master-a24979a
Functions
conf_state.c File Reference

Confbridge state handling. More...

#include "asterisk.h"
#include "asterisk/logger.h"
#include "asterisk/test.h"
#include "include/conf_state.h"
#include "include/confbridge.h"
Include dependency graph for conf_state.c:

Go to the source code of this file.

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...
 
static void conf_mute_moh_inactive_waitmarked (struct confbridge_user *user)
 

Detailed Description

Confbridge state handling.

Author
Terry Wilson <twilson@digium.com> 

This file contains functions that are used from multiple conf_state files for handling stage change behavior.

Definition in file conf_state.c.

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 80 of file conf_state.c.

81 {
82  ast_debug(1, "Changing conference '%s' state from %s to %s\n", user->conference->name, user->conference->state->name, newstate->name);
83  ast_test_suite_event_notify("CONF_CHANGE_STATE", "Conference: %s\r\nOldState: %s\r\nNewState: %s\r\n",
84  user->conference->name,
85  user->conference->state->name,
86  newstate->name);
87  if (user->conference->state->exit) {
88  user->conference->state->exit(user);
89  }
90  user->conference->state = newstate;
91  if (user->conference->state->entry) {
92  user->conference->state->entry(user);
93  }
94 }
#define ast_debug(level,...)
Log a DEBUG message.
const char * name
Definition: conf_state.h:49
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 65 of file conf_state.c.

66 {
67  conf_add_user_waiting(user->conference, user);
70 }
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:56

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 72 of file conf_state.c.

73 {
74  conf_remove_user_waiting(user->conference, user);
75  if (user->playing_moh) {
77  }
78 }
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 45 of file conf_state.c.

46 {
47  ast_log(LOG_ERROR, "Invalid event for confbridge user '%s'\n", user->u_profile.name);
48 }
#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().

◆ conf_mute_moh_inactive_waitmarked()

static void conf_mute_moh_inactive_waitmarked ( struct confbridge_user user)
static

Definition at line 56 of file conf_state.c.

57 {
58  /* Start music on hold if needed */
59  if (ast_test_flag(&user->u_profile, USER_OPT_MUSICONHOLD)) {
61  }
63 }
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_moh_start(struct confbridge_user *user)
Start MOH for the conference user.
@ USER_OPT_MUSICONHOLD
Definition: confbridge.h:56
#define ast_test_flag(p, flag)
Definition: utils.h:63

References ast_test_flag, conf_moh_start(), conf_update_user_mute(), and USER_OPT_MUSICONHOLD.

Referenced by conf_default_join_waitmarked().