| 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 "include/confbridge.h" |
| 33 |
#include "include/conf_state.h" |
| 34 |
|
| 35 |
static void join_unmarked(struct confbridge_user *user); |
| 36 |
static void join_marked(struct confbridge_user *user); |
| 37 |
static void leave_unmarked(struct confbridge_user *user); |
| 38 |
|
| 39 |
struct confbridge_state STATE_MULTI = { |
| 40 |
.name = "MULTI", |
| 41 |
.join_unmarked = join_unmarked, |
| 42 |
.join_waitmarked = conf_default_join_waitmarked, |
| 43 |
.join_marked = join_marked, |
| 44 |
.leave_unmarked = leave_unmarked, |
| 45 |
.leave_waitmarked = conf_default_leave_waitmarked, |
| 46 |
}; |
| 47 |
struct confbridge_state *CONF_STATE_MULTI = &STATE_MULTI; |
| 48 |
|
| 49 |
static void join_unmarked(struct confbridge_user *user) |
| 50 |
{ |
| 51 |
conf_add_user_active(user->conference, user); |
| 52 |
conf_update_user_mute(user); |
| 53 |
} |
| 54 |
|
| 55 |
static void join_marked(struct confbridge_user *user) |
| 56 |
{ |
| 57 |
conf_add_user_marked(user->conference, user); |
| 58 |
conf_update_user_mute(user); |
| 59 |
|
| 60 |
conf_change_state(user, CONF_STATE_MULTI_MARKED); |
| 61 |
} |
| 62 |
|
| 63 |
static void leave_unmarked(struct confbridge_user *user) |
| 64 |
{ |
| 65 |
conf_remove_user_active(user->conference, user); |
| 66 |
if (user->conference->activeusers == 1) { |
| 67 |
conf_change_state(user, CONF_STATE_SINGLE); |
| 68 |
} |
| 69 |
} |