| 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 |
#include "asterisk.h" |
| 33 |
#include "asterisk/devicestate.h" |
| 34 |
#include "include/confbridge.h" |
| 35 |
#include "include/conf_state.h" |
| 36 |
|
| 37 |
static void join_unmarked(struct confbridge_user *user); |
| 38 |
static void join_waitmarked(struct confbridge_user *user); |
| 39 |
static void join_marked(struct confbridge_user *user); |
| 40 |
static void transition_to_empty(struct confbridge_user *user); |
| 41 |
|
| 42 |
struct confbridge_state STATE_EMPTY = { |
| 43 |
.name = "EMPTY", |
| 44 |
.join_unmarked = join_unmarked, |
| 45 |
.join_waitmarked = join_waitmarked, |
| 46 |
.join_marked = join_marked, |
| 47 |
.entry = transition_to_empty, |
| 48 |
}; |
| 49 |
|
| 50 |
struct confbridge_state *CONF_STATE_EMPTY = &STATE_EMPTY; |
| 51 |
|
| 52 |
static void join_unmarked(struct confbridge_user *user) |
| 53 |
{ |
| 54 |
conf_add_user_active(user->conference, user); |
| 55 |
conf_handle_first_join(user->conference); |
| 56 |
conf_add_post_join_action(user, conf_handle_only_person); |
| 57 |
|
| 58 |
conf_change_state(user, CONF_STATE_SINGLE); |
| 59 |
} |
| 60 |
|
| 61 |
static void join_waitmarked(struct confbridge_user *user) |
| 62 |
{ |
| 63 |
conf_default_join_waitmarked(user); |
| 64 |
conf_handle_first_join(user->conference); |
| 65 |
|
| 66 |
conf_change_state(user, CONF_STATE_INACTIVE); |
| 67 |
} |
| 68 |
|
| 69 |
static void join_marked(struct confbridge_user *user) |
| 70 |
{ |
| 71 |
conf_add_user_marked(user->conference, user); |
| 72 |
conf_handle_first_join(user->conference); |
| 73 |
conf_add_post_join_action(user, conf_handle_only_person); |
| 74 |
|
| 75 |
conf_change_state(user, CONF_STATE_SINGLE_MARKED); |
| 76 |
} |
| 77 |
|
| 78 |
static void transition_to_empty(struct confbridge_user *user) |
| 79 |
{ |
| 80 |
|
| 81 |
ast_devstate_changed(AST_DEVICE_NOT_INUSE, AST_DEVSTATE_CACHABLE, "confbridge:%s", user->conference->name); |
| 82 |
conf_ended(user->conference); |
| 83 |
} |