Skip to content
Snippets Groups Projects
Commit c373dc42 authored by Richard Alam's avatar Richard Alam
Browse files

For eject of voice conference user

 - Sometimes ejecting voice conf users using "conference vconf kick all" doesn't work. We need to
   forcefully eject the user by using "uuid_kill uuid".
parent 13d610f7
No related branches found
No related tags found
No related merge requests found
...@@ -168,7 +168,9 @@ public class FreeswitchApplication implements IDelayedCommandListener{ ...@@ -168,7 +168,9 @@ public class FreeswitchApplication implements IDelayedCommandListener{
EjectAllUsersCommand cmd = (EjectAllUsersCommand) command; EjectAllUsersCommand cmd = (EjectAllUsersCommand) command;
manager.ejectAll(cmd); manager.ejectAll(cmd);
CheckIfConfIsRunningCommand command = new CheckIfConfIsRunningCommand(cmd.getRoom(), cmd.getRequesterId()); CheckIfConfIsRunningCommand command = new CheckIfConfIsRunningCommand(cmd.getRoom(),
cmd.getRequesterId(),
delayedCommandSenderService);
delayedCommandSenderService.handleMessage(command, 5000); delayedCommandSenderService.handleMessage(command, 5000);
} else if (command instanceof TransferUserToMeetingCommand) { } else if (command instanceof TransferUserToMeetingCommand) {
TransferUserToMeetingCommand cmd = (TransferUserToMeetingCommand) command; TransferUserToMeetingCommand cmd = (TransferUserToMeetingCommand) command;
......
...@@ -20,6 +20,7 @@ package org.bigbluebutton.freeswitch.voice.freeswitch.actions; ...@@ -20,6 +20,7 @@ package org.bigbluebutton.freeswitch.voice.freeswitch.actions;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.bigbluebutton.freeswitch.voice.events.ConferenceEventListener; import org.bigbluebutton.freeswitch.voice.events.ConferenceEventListener;
import org.bigbluebutton.freeswitch.voice.freeswitch.DelayedCommandSenderService;
import org.bigbluebutton.freeswitch.voice.freeswitch.response.ConferenceMember; import org.bigbluebutton.freeswitch.voice.freeswitch.response.ConferenceMember;
import org.bigbluebutton.freeswitch.voice.freeswitch.response.XMLResponseConferenceListParser; import org.bigbluebutton.freeswitch.voice.freeswitch.response.XMLResponseConferenceListParser;
import org.freeswitch.esl.client.transport.message.EslMessage; import org.freeswitch.esl.client.transport.message.EslMessage;
...@@ -36,9 +37,11 @@ import java.util.regex.Matcher; ...@@ -36,9 +37,11 @@ import java.util.regex.Matcher;
public class CheckIfConfIsRunningCommand extends FreeswitchCommand { public class CheckIfConfIsRunningCommand extends FreeswitchCommand {
private static Logger log = LoggerFactory.getLogger(CheckIfConfIsRunningCommand.class); private static Logger log = LoggerFactory.getLogger(CheckIfConfIsRunningCommand.class);
private DelayedCommandSenderService delayedCommandSenderService;
public CheckIfConfIsRunningCommand(String room, String requesterId) { public CheckIfConfIsRunningCommand(String room, String requesterId, DelayedCommandSenderService delayedCommandSenderService) {
super(room, requesterId); super(room, requesterId);
this.delayedCommandSenderService = delayedCommandSenderService;
} }
@Override @Override
...@@ -94,12 +97,24 @@ public class CheckIfConfIsRunningCommand extends FreeswitchCommand { ...@@ -94,12 +97,24 @@ public class CheckIfConfIsRunningCommand extends FreeswitchCommand {
String uuid = member.getUUID(); String uuid = member.getUUID();
log.info("WARNING! User possibly stuck in conference. uuid=" + uuid log.info("WARNING! User possibly stuck in conference. uuid=" + uuid
+ ",caller=" + callerIdName + ",callerId=" + callerId + ",conf=" + room); + ",caller=" + callerIdName + ",callerId=" + callerId + ",conf=" + room);
} else if ("recording_node".equals(member.getMemberType())) {
} // We have stubborn users that cannot be ejected from the voice conference.
// This results in the voice conference hanging around for potentially a long time.
// Force ejection by killing their uuid. (ralam Oct 1, 2019)
ForceEjectUserCommand forceEjectUserCommand = new ForceEjectUserCommand(getRoom(),
member.getId().toString(),
member.getUUID());
delayedCommandSenderService.handleMessage(forceEjectUserCommand, 5000L);
} else if ("recording_node".equals(member.getMemberType())) {
}
} }
// Check again if the conference is still running after ejecting the users. (ralam Oct. 1, 2019)
CheckIfConfIsRunningCommand command = new CheckIfConfIsRunningCommand(getRoom(),
getRequesterId(),
delayedCommandSenderService);
delayedCommandSenderService.handleMessage(command, 10000);
} else { } else {
log.info("INFO! Successfully ejected all users from conference {}.", room); log.info("INFO! Successfully ejected all users from conference {}.", room);
} }
......
package org.bigbluebutton.freeswitch.voice.freeswitch.actions;
import com.google.gson.Gson;
import org.bigbluebutton.freeswitch.voice.events.ConferenceEventListener;
import org.freeswitch.esl.client.transport.message.EslMessage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class ForceEjectUserCommand extends FreeswitchCommand {
private static Logger log = LoggerFactory.getLogger(ForceEjectUserCommand.class);
private final String voiceConf;
private final String userId;
private final String uuid;
public ForceEjectUserCommand(String voiceConf, String userId, String uuid) {
super(voiceConf, userId);
this.voiceConf = voiceConf;
this.userId = userId;
this.uuid = uuid;
}
@Override
public String getCommand() {
return "uuid_kill " + uuid;
}
@Override
public String getCommandArgs() {
log.debug("Force eject user " + userId + " from conf " + voiceConf + " by uuid_kill " + uuid);
return "";
}
public void handleResponse(EslMessage response, ConferenceEventListener eventListener) {
Gson gson = new Gson();
log.info(gson.toJson(response.getBodyLines()));
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment