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

void conf_change_state ( struct confbridge_user user,
struct confbridge_state newstate 
)

Execute conference state transition because of a user action.

Parameters:
user The user that joined/left
newstate The state to transition to

Definition at line 82 of file conf_state.c.

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

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

00083 {
00084    ast_debug(1, "Changing conference '%s' state from %s to %s\n", user->conference->name, user->conference->state->name, newstate->name);
00085    ast_test_suite_event_notify("CONF_CHANGE_STATE", "Conference: %s\r\nOldState: %s\r\nNewState: %s\r\n",
00086          user->conference->name,
00087          user->conference->state->name,
00088          newstate->name);
00089    if (user->conference->state->exit) {
00090       user->conference->state->exit(user);
00091    }
00092    user->conference->state = newstate;
00093    if (user->conference->state->entry) {
00094       user->conference->state->entry(user);
00095    }
00096 }

void conf_default_join_waitmarked ( struct confbridge_user user  ) 

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

Definition at line 67 of file conf_state.c.

References conf_add_post_join_action(), conf_add_user_waiting(), conf_handle_inactive_waitmarked(), conf_mute_moh_inactive_waitmarked(), and confbridge_user::conference.

Referenced by join_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 74 of file conf_state.c.

References conf_moh_stop(), conf_remove_user_waiting(), confbridge_user::conference, and confbridge_user::playing_moh.

Referenced by leave_waitmarked().

00075 {
00076    conf_remove_user_waiting(user->conference, user);
00077    if (user->playing_moh) {
00078       conf_moh_stop(user);
00079    }
00080 }

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.

References ast_log, LOG_ERROR, user_profile::name, and confbridge_user::u_profile.

Referenced by handle_conf_user_join(), and handle_conf_user_leave().

00046 {
00047    ast_log(LOG_ERROR, "Invalid event for confbridge user '%s'\n", user->u_profile.name);
00048 }

static void conf_mute_moh_inactive_waitmarked ( struct confbridge_user user  )  [static]

Definition at line 58 of file conf_state.c.

References ast_test_flag, conf_moh_start(), conf_update_user_mute(), confbridge_user::u_profile, and USER_OPT_MUSICONHOLD.

Referenced by conf_default_join_waitmarked().

00059 {
00060    /* Start music on hold if needed */
00061    if (ast_test_flag(&user->u_profile, USER_OPT_MUSICONHOLD)) {
00062       conf_moh_start(user);
00063    }
00064    conf_update_user_mute(user);
00065 }


Generated on Thu Apr 16 06:30:20 2015 for Asterisk - The Open Source Telephony Project by  doxygen 1.5.6