mod_conference: add mute on/mute off actions in addition to toggle mute action (MODAPP-370)

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15845 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris 2009-12-08 17:25:28 +00:00
parent 2f4fcf9a9f
commit 1c9dae81a9
1 changed files with 20 additions and 0 deletions

View File

@ -94,6 +94,8 @@ static struct {
typedef enum {
CALLER_CONTROL_MUTE,
CALLER_CONTROL_MUTE_ON,
CALLER_CONTROL_MUTE_OFF,
CALLER_CONTROL_DEAF_MUTE,
CALLER_CONTROL_ENERGY_UP,
CALLER_CONTROL_ENERGY_EQU_CONF,
@ -1372,6 +1374,22 @@ static void conference_loop_fn_mute_toggle(conference_member_t *member, caller_c
}
}
static void conference_loop_fn_mute_on(conference_member_t *member, caller_control_action_t *action)
{
if (switch_test_flag(member, MFLAG_CAN_SPEAK)) {
conf_api_sub_mute(member, NULL, NULL);
}
}
static void conference_loop_fn_mute_off(conference_member_t *member, caller_control_action_t *action)
{
if (!switch_test_flag(member, MFLAG_CAN_SPEAK)) {
conf_api_sub_unmute(member, NULL, NULL);
if (!switch_test_flag(member, MFLAG_CAN_HEAR)) {
conf_api_sub_undeaf(member, NULL, NULL);
}
}
}
static void conference_loop_fn_lock_toggle(conference_member_t *member, caller_control_action_t *action)
{
@ -2008,6 +2026,8 @@ static void launch_conference_loop_input(conference_member_t *member, switch_mem
static caller_control_fn_table_t ccfntbl[] = {
{"mute", "0", CALLER_CONTROL_MUTE, conference_loop_fn_mute_toggle},
{"mute on", NULL, CALLER_CONTROL_MUTE_ON, conference_loop_fn_mute_on},
{"mute off", NULL, CALLER_CONTROL_MUTE_OFF, conference_loop_fn_mute_off},
{"deaf mute", "*", CALLER_CONTROL_DEAF_MUTE, conference_loop_fn_deafmute_toggle},
{"energy up", "9", CALLER_CONTROL_ENERGY_UP, conference_loop_fn_energy_up},
{"energy equ", "8", CALLER_CONTROL_ENERGY_EQU_CONF, conference_loop_fn_energy_equ_conf},