| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
#include "asterisk.h" |
| 36 |
|
| 37 |
#include "asterisk/logger.h" |
| 38 |
#include "asterisk/test.h" |
| 39 |
#include "include/conf_state.h" |
| 40 |
#include "include/confbridge.h" |
| 41 |
|
| 42 |
void conf_invalid_event_fn(struct confbridge_user *user) |
| 43 |
{ |
| 44 |
ast_log(LOG_ERROR, "Invalid event for confbridge user '%s'\n", user->u_profile.name); |
| 45 |
} |
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
static void conf_mute_moh_inactive_waitmarked(struct confbridge_user *user) |
| 54 |
{ |
| 55 |
|
| 56 |
if (ast_test_flag(&user->u_profile, USER_OPT_MUSICONHOLD)) { |
| 57 |
conf_moh_start(user); |
| 58 |
} |
| 59 |
conf_update_user_mute(user); |
| 60 |
} |
| 61 |
|
| 62 |
void conf_default_join_waitmarked(struct confbridge_user *user) |
| 63 |
{ |
| 64 |
conf_add_user_waiting(user->conference, user); |
| 65 |
conf_mute_moh_inactive_waitmarked(user); |
| 66 |
conf_add_post_join_action(user, conf_handle_inactive_waitmarked); |
| 67 |
} |
| 68 |
|
| 69 |
void conf_default_leave_waitmarked(struct confbridge_user *user) |
| 70 |
{ |
| 71 |
conf_remove_user_waiting(user->conference, user); |
| 72 |
if (user->playing_moh) { |
| 73 |
conf_moh_stop(user); |
| 74 |
} |
| 75 |
} |
| 76 |
|
| 77 |
void conf_change_state(struct confbridge_user *user, struct confbridge_state *newstate) |
| 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 |
} |