Index: apps/app_meetme.c =================================================================== --- apps/app_meetme.c (revision 315142) +++ apps/app_meetme.c (working copy) @@ -522,6 +522,31 @@ MeetmeListRoomsComplete. + + + MeetMe conference Administration (channel specific). + + + + + + + + + + + + + Run admin command for a specific + channel in any conference. + + ***/ #define CONFIG_FILE_NAME "meetme.conf" @@ -4981,6 +5006,52 @@ return 0; } +static int action_meetmechanneladmin(struct mansession *s, const struct message *m) +{ + const char *channel = astman_get_header(m, "channel"); + const char *command = astman_get_header(m, "command"); + struct ast_conference *conf = NULL; + struct ast_conf_user *user = NULL; + + AST_LIST_LOCK(&confs); + AST_LIST_TRAVERSE(&confs, conf, list) { + if ((user = ao2_callback(conf->usercontainer, 0, user_chan_cb, channel))) { + break; + } + } + + if (!user) { + astman_send_error(s, m, "Channel does not participates any conference."); + AST_LIST_UNLOCK(&confs); + return 0; + } + + if(!strncasecmp(command,"mute",4) && (command[4] == 0)) + { + user->adminflags |= ADMINFLAG_MUTED; + astman_send_ack(s, m, "User muted"); + } + else if(!strncasecmp(command,"unmute",6) && (command[6] == 0)) + { + user->adminflags &= ~ADMINFLAG_MUTED; + astman_send_ack(s, m, "User unmuted"); + } + else if(!strncasecmp(command,"kick",4) && (command[4] == 0)) + { + user->adminflags |= ADMINFLAG_KICKME; + astman_send_ack(s, m, "User kicked"); + } + else + { + astman_send_error(s, m, "Invalid command."); + } + + ao2_ref(user, -1); + AST_LIST_UNLOCK(&confs); + + return 0; +} + static void *recordthread(void *args) { struct ast_conference *cnf = args; @@ -7243,6 +7314,7 @@ res |= ast_manager_unregister("MeetmeUnmute"); res |= ast_manager_unregister("MeetmeList"); res |= ast_manager_unregister("MeetmeListRooms"); + res |= ast_manager_unregister("MeetmeChannelAdmin"); res |= ast_unregister_application(app4); res |= ast_unregister_application(app3); res |= ast_unregister_application(app2); @@ -7279,6 +7351,7 @@ res |= ast_manager_register_xml("MeetmeUnmute", EVENT_FLAG_CALL, action_meetmeunmute); res |= ast_manager_register_xml("MeetmeList", EVENT_FLAG_REPORTING, action_meetmelist); res |= ast_manager_register_xml("MeetmeListRooms", EVENT_FLAG_REPORTING, action_meetmelistrooms); + res |= ast_manager_register_xml("MeetmeChannelAdmin",EVENT_FLAG_CALL, action_meetmechanneladmin); res |= ast_register_application_xml(app4, channel_admin_exec); res |= ast_register_application_xml(app3, admin_exec); res |= ast_register_application_xml(app2, count_exec);