diff --git a/bigbluebutton-apps/.classpath b/bigbluebutton-apps/.classpath index c404bb9469..a675e12ff8 100644 --- a/bigbluebutton-apps/.classpath +++ b/bigbluebutton-apps/.classpath @@ -1,7 +1,7 @@ - + diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/KonferenceManager.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/KonferenceManager.java index a5c39197e6..29ba0f09f5 100644 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/KonferenceManager.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/KonferenceManager.java @@ -1,25 +1,17 @@ package org.bigbluebutton.webconference.voice.asterisk.konference; -import org.asteriskjava.live.ManagerCommunicationException; import org.asteriskjava.manager.ManagerConnection; import org.asteriskjava.manager.ManagerEventListener; -import org.asteriskjava.manager.action.CommandAction; import org.asteriskjava.manager.event.ManagerEvent; -import org.asteriskjava.manager.response.CommandResponse; -import org.asteriskjava.manager.response.ManagerError; -import org.asteriskjava.manager.response.ManagerResponse; -import org.asteriskjava.util.DateUtil; import org.asteriskjava.util.Log; import org.asteriskjava.util.LogFactory; -import org.bigbluebutton.webconference.voice.asterisk.konference.events.AbstractKonferenceEvent; -import org.bigbluebutton.webconference.voice.asterisk.konference.events.KonferenceJoinEvent; -import org.bigbluebutton.webconference.voice.asterisk.konference.events.KonferenceLeaveEvent; -import org.bigbluebutton.webconference.voice.asterisk.konference.events.KonferenceMemberMuteEvent; -import org.bigbluebutton.webconference.voice.asterisk.konference.events.KonferenceMemberUnmuteEvent; -import org.bigbluebutton.webconference.voice.asterisk.konference.events.KonferenceStateEvent; +import org.bigbluebutton.webconference.voice.asterisk.konference.events.AbstractConferenceEvent; +import org.bigbluebutton.webconference.voice.asterisk.konference.events.ConferenceJoinEvent; +import org.bigbluebutton.webconference.voice.asterisk.konference.events.ConferenceLeaveEvent; +import org.bigbluebutton.webconference.voice.asterisk.konference.events.ConferenceMemberMuteEvent; +import org.bigbluebutton.webconference.voice.asterisk.konference.events.ConferenceMemberUnmuteEvent; +import org.bigbluebutton.webconference.voice.asterisk.konference.events.ConferenceStateEvent; -import java.util.*; -import java.util.regex.Matcher; import java.util.regex.Pattern; class KonferenceManager implements ManagerEventListener { @@ -29,18 +21,16 @@ class KonferenceManager implements ManagerEventListener { private final Log logger = LogFactory.getLog(getClass()); private final ManagerConnection manager; -// private final Map rooms; - KonferenceManager(ManagerConnection manager) { this.manager = manager; // this.rooms = new HashMap(); - manager.registerUserEventClass(KonferenceJoinEvent.class); - manager.registerUserEventClass(KonferenceLeaveEvent.class); - manager.registerUserEventClass(KonferenceStateEvent.class); - manager.registerUserEventClass(KonferenceMemberMuteEvent.class); - manager.registerUserEventClass(KonferenceMemberUnmuteEvent.class); + manager.registerUserEventClass(ConferenceJoinEvent.class); + manager.registerUserEventClass(ConferenceLeaveEvent.class); + manager.registerUserEventClass(ConferenceStateEvent.class); + manager.registerUserEventClass(ConferenceMemberMuteEvent.class); + manager.registerUserEventClass(ConferenceMemberUnmuteEvent.class); } @@ -54,7 +44,7 @@ class KonferenceManager implements ManagerEventListener { */ } - private void handleConferenceEvent(AbstractKonferenceEvent event) { + private void handleConferenceEvent(AbstractConferenceEvent event) { } @@ -261,6 +251,6 @@ class KonferenceManager implements ManagerEventListener { } */ public void onManagerEvent(ManagerEvent event) { - handleConferenceEvent((AbstractKonferenceEvent)event); + handleConferenceEvent((AbstractConferenceEvent)event); } } diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/AbstractKonferenceEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/AbstractConferenceEvent.java similarity index 80% rename from bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/AbstractKonferenceEvent.java rename to bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/AbstractConferenceEvent.java index bd308eca8a..164935986c 100644 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/AbstractKonferenceEvent.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/AbstractConferenceEvent.java @@ -2,12 +2,12 @@ package org.bigbluebutton.webconference.voice.asterisk.konference.events; import org.asteriskjava.manager.event.ManagerEvent; -public abstract class AbstractKonferenceEvent extends ManagerEvent { +public abstract class AbstractConferenceEvent extends ManagerEvent { private static final long serialVersionUID = 4049251911383919117L; private String channel; private String conferenceName; - protected AbstractKonferenceEvent(Object source) { + protected AbstractConferenceEvent(Object source) { super(source); } diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/KonferenceJoinEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/ConferenceJoinEvent.java similarity index 87% rename from bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/KonferenceJoinEvent.java rename to bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/ConferenceJoinEvent.java index e7d7c37b15..d206f6beea 100644 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/KonferenceJoinEvent.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/ConferenceJoinEvent.java @@ -1,6 +1,6 @@ package org.bigbluebutton.webconference.voice.asterisk.konference.events; -public class KonferenceJoinEvent extends AbstractKonferenceEvent { +public class ConferenceJoinEvent extends AbstractConferenceEvent { private static final long serialVersionUID = 1926565708226475330L; @@ -13,7 +13,7 @@ public class KonferenceJoinEvent extends AbstractKonferenceEvent { private Integer moderators; private Integer count; - public KonferenceJoinEvent(Object source) { + public ConferenceJoinEvent(Object source) { super(source); } diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/KonferenceLeaveEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/ConferenceLeaveEvent.java similarity index 84% rename from bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/KonferenceLeaveEvent.java rename to bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/ConferenceLeaveEvent.java index 7ce0c6ff94..b9fec62c4f 100644 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/KonferenceLeaveEvent.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/ConferenceLeaveEvent.java @@ -1,7 +1,8 @@ package org.bigbluebutton.webconference.voice.asterisk.konference.events; -public class KonferenceLeaveEvent extends AbstractKonferenceEvent { +public class ConferenceLeaveEvent extends AbstractConferenceEvent { + private static final long serialVersionUID = 4836233262809045338L; private String type; private String uniqueID; private Integer member; @@ -12,8 +13,7 @@ public class KonferenceLeaveEvent extends AbstractKonferenceEvent { private Integer moderators; private Integer count; - public KonferenceLeaveEvent(Object source) - { + public ConferenceLeaveEvent(Object source) { super(source); } diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/ConferenceLockEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/ConferenceLockEvent.java new file mode 100644 index 0000000000..46ca39295d --- /dev/null +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/ConferenceLockEvent.java @@ -0,0 +1,8 @@ +package org.bigbluebutton.webconference.voice.asterisk.konference.events; + +public class ConferenceLockEvent extends AbstractConferenceEvent { + + public ConferenceLockEvent(Object source) { + super(source); + } +} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/ConferenceMemberMuteEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/ConferenceMemberMuteEvent.java new file mode 100644 index 0000000000..99cdc63069 --- /dev/null +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/ConferenceMemberMuteEvent.java @@ -0,0 +1,8 @@ +package org.bigbluebutton.webconference.voice.asterisk.konference.events; + +public class ConferenceMemberMuteEvent extends AbstractConferenceEvent { + + public ConferenceMemberMuteEvent(Object source) { + super(source); + } +} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/ConferenceMemberUnmuteEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/ConferenceMemberUnmuteEvent.java new file mode 100644 index 0000000000..4101a221cf --- /dev/null +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/ConferenceMemberUnmuteEvent.java @@ -0,0 +1,8 @@ +package org.bigbluebutton.webconference.voice.asterisk.konference.events; + +public class ConferenceMemberUnmuteEvent extends AbstractConferenceEvent { + + public ConferenceMemberUnmuteEvent(Object source) { + super(source); + } +} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/KonferenceMuteEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/ConferenceMuteEvent.java similarity index 76% rename from bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/KonferenceMuteEvent.java rename to bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/ConferenceMuteEvent.java index 3d414bebb1..042b5302e5 100644 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/KonferenceMuteEvent.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/ConferenceMuteEvent.java @@ -2,13 +2,13 @@ package org.bigbluebutton.webconference.voice.asterisk.konference.events; import org.asteriskjava.manager.event.ManagerEvent; -public class KonferenceMuteEvent extends ManagerEvent { +public class ConferenceMuteEvent extends ManagerEvent { private static final long serialVersionUID = 1L; private String conferenceName; - public KonferenceMuteEvent(Object source) { + public ConferenceMuteEvent(Object source) { super(source); } diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/KonferenceSoundCompleteEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/ConferenceSoundCompleteEvent.java similarity index 65% rename from bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/KonferenceSoundCompleteEvent.java rename to bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/ConferenceSoundCompleteEvent.java index 772a6fbe2d..85016e55f0 100644 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/KonferenceSoundCompleteEvent.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/ConferenceSoundCompleteEvent.java @@ -1,10 +1,10 @@ package org.bigbluebutton.webconference.voice.asterisk.konference.events; -public class KonferenceSoundCompleteEvent extends AbstractKonferenceEvent { +public class ConferenceSoundCompleteEvent extends AbstractConferenceEvent { private String sound; - public KonferenceSoundCompleteEvent(Object source) { + public ConferenceSoundCompleteEvent(Object source) { super(source); } diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/KonferenceStateEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/ConferenceStateEvent.java similarity index 74% rename from bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/KonferenceStateEvent.java rename to bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/ConferenceStateEvent.java index 5505792c29..b679f6094d 100644 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/KonferenceStateEvent.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/ConferenceStateEvent.java @@ -1,11 +1,11 @@ package org.bigbluebutton.webconference.voice.asterisk.konference.events; -public class KonferenceStateEvent extends AbstractKonferenceEvent { +public class ConferenceStateEvent extends AbstractConferenceEvent { private String flags; private String state; - public KonferenceStateEvent(Object source) + public ConferenceStateEvent(Object source) { super(source); } diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/KonferenceUnlockEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/ConferenceUnlockEvent.java similarity index 76% rename from bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/KonferenceUnlockEvent.java rename to bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/ConferenceUnlockEvent.java index a309cfd5f9..0c8d4612ab 100644 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/KonferenceUnlockEvent.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/ConferenceUnlockEvent.java @@ -2,13 +2,13 @@ package org.bigbluebutton.webconference.voice.asterisk.konference.events; import org.asteriskjava.manager.event.ManagerEvent; -public class KonferenceUnlockEvent extends ManagerEvent { +public class ConferenceUnlockEvent extends ManagerEvent { private static final long serialVersionUID = 1L; private String conferenceName; - public KonferenceUnlockEvent(Object source) + public ConferenceUnlockEvent(Object source) { super(source); } diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/KonferenceUnmuteEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/ConferenceUnmuteEvent.java similarity index 76% rename from bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/KonferenceUnmuteEvent.java rename to bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/ConferenceUnmuteEvent.java index 9b78af0dc5..4af72e8e44 100644 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/KonferenceUnmuteEvent.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/ConferenceUnmuteEvent.java @@ -2,13 +2,13 @@ package org.bigbluebutton.webconference.voice.asterisk.konference.events; import org.asteriskjava.manager.event.ManagerEvent; -public class KonferenceUnmuteEvent extends ManagerEvent { +public class ConferenceUnmuteEvent extends ManagerEvent { private static final long serialVersionUID = 1L; private String conferenceName; - public KonferenceUnmuteEvent(Object source) + public ConferenceUnmuteEvent(Object source) { super(source); } diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/KonferenceLockEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/KonferenceLockEvent.java deleted file mode 100644 index 7ad53c6227..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/KonferenceLockEvent.java +++ /dev/null @@ -1,8 +0,0 @@ -package org.bigbluebutton.webconference.voice.asterisk.konference.events; - -public class KonferenceLockEvent extends AbstractKonferenceEvent { - - public KonferenceLockEvent(Object source) { - super(source); - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/KonferenceMemberMuteEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/KonferenceMemberMuteEvent.java deleted file mode 100644 index 56f453d18f..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/KonferenceMemberMuteEvent.java +++ /dev/null @@ -1,8 +0,0 @@ -package org.bigbluebutton.webconference.voice.asterisk.konference.events; - -public class KonferenceMemberMuteEvent extends AbstractKonferenceEvent { - - public KonferenceMemberMuteEvent(Object source) { - super(source); - } -} diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/KonferenceMemberUnmuteEvent.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/KonferenceMemberUnmuteEvent.java deleted file mode 100644 index 156f2db8c9..0000000000 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/webconference/voice/asterisk/konference/events/KonferenceMemberUnmuteEvent.java +++ /dev/null @@ -1,8 +0,0 @@ -package org.bigbluebutton.webconference.voice.asterisk.konference.events; - -public class KonferenceMemberUnmuteEvent extends AbstractKonferenceEvent { - - public KonferenceMemberUnmuteEvent(Object source) { - super(source); - } -} diff --git a/bigbluebutton-apps/test/commandline/HelloEvents.java b/bigbluebutton-apps/test/commandline/HelloEvents.java index ef0c5992cf..38e09bca7b 100644 --- a/bigbluebutton-apps/test/commandline/HelloEvents.java +++ b/bigbluebutton-apps/test/commandline/HelloEvents.java @@ -1,16 +1,32 @@ import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.regex.Pattern; +import org.asteriskjava.live.ManagerCommunicationException; import org.asteriskjava.manager.AuthenticationFailedException; import org.asteriskjava.manager.ManagerConnection; import org.asteriskjava.manager.ManagerConnectionFactory; import org.asteriskjava.manager.ManagerEventListener; import org.asteriskjava.manager.TimeoutException; +import org.asteriskjava.manager.action.CommandAction; import org.asteriskjava.manager.action.StatusAction; import org.asteriskjava.manager.event.ManagerEvent; +import org.asteriskjava.manager.response.CommandResponse; +import org.asteriskjava.manager.response.ManagerError; +import org.asteriskjava.manager.response.ManagerResponse; +import org.bigbluebutton.webconference.voice.asterisk.konference.events.ConferenceJoinEvent; +import org.bigbluebutton.webconference.voice.asterisk.konference.events.ConferenceLeaveEvent; +import org.bigbluebutton.webconference.voice.asterisk.konference.events.ConferenceMemberMuteEvent; +import org.bigbluebutton.webconference.voice.asterisk.konference.events.ConferenceMemberUnmuteEvent; +import org.bigbluebutton.webconference.voice.asterisk.konference.events.ConferenceStateEvent; -public class HelloEvents implements ManagerEventListener -{ +public class HelloEvents implements ManagerEventListener { + private static final String KONFERENCE_LIST_COMMAND = "konference list"; + private static final Pattern KONFERENCE_LIST_PATTERN = Pattern.compile("^User #: ([0-9]+).*Channel: (\\S+).*$"); + private ManagerConnection managerConnection; public HelloEvents() throws IOException @@ -19,6 +35,11 @@ public class HelloEvents implements ManagerEventListener "192.168.0.120", "bbb", "secret"); this.managerConnection = factory.createManagerConnection(); + managerConnection.registerUserEventClass(ConferenceJoinEvent.class); + managerConnection.registerUserEventClass(ConferenceLeaveEvent.class); + managerConnection.registerUserEventClass(ConferenceStateEvent.class); + managerConnection.registerUserEventClass(ConferenceMemberMuteEvent.class); + managerConnection.registerUserEventClass(ConferenceMemberUnmuteEvent.class); } public void run() throws IOException, AuthenticationFailedException, @@ -36,12 +57,129 @@ public class HelloEvents implements ManagerEventListener // wait 10 seconds for events to come in Thread.sleep(10000); - + populateRoom("85115"); // and finally log off and disconnect // managerConnection.logoff(); } + private void populateRoom(String room) { + final CommandAction meetMeListAction; + ManagerResponse response = null; + final List lines; + final Collection userNumbers = new ArrayList(); // list of user numbers in the room + + meetMeListAction = new CommandAction(KONFERENCE_LIST_COMMAND + " " + room); + try { + response = managerConnection.sendAction(meetMeListAction); + } catch (TimeoutException e) { + System.out.println("Unable to send \"" + KONFERENCE_LIST_COMMAND + "\" command"); + return; + } catch (IllegalArgumentException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (IllegalStateException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + if (response instanceof ManagerError) { + System.out.println("Unable to send \"" + KONFERENCE_LIST_COMMAND + "\" command: " + response.getMessage()); + return; + } + + if (!(response instanceof CommandResponse)) { + System.out.println("Response to \"" + KONFERENCE_LIST_COMMAND + "\" command is not a CommandResponse but " + + response.getClass()); + return; + } + + lines = ((CommandResponse) response).getResult(); + for (String line : lines) { + System.out.println(line); + /* + final Matcher matcher; + final Integer userNumber; + boolean muted = false; + boolean talking = false; + ConferenceMemberImpl channelUser; + ConferenceMemberImpl roomUser; + + matcher = KONFERENCE_LIST_PATTERN.matcher(line); + if (!matcher.matches()) { + continue; + } + + userNumber = Integer.valueOf(matcher.group(1)); + channel = channelManager.getChannelImplByName(matcher.group(2)); + + userNumbers.add(userNumber); + + if (line.contains("(Admin Muted)") || line.contains("(Muted)")) { + muted = true; + } + + if (line.contains("(talking)")) { + talking = true; + } + + channelUser = channel.getMeetMeUser(); + if (channelUser != null && channelUser.getRoom() != room) { + channelUser.left(DateUtil.getDate()); + channelUser = null; + } + + roomUser = room.getUser(userNumber); + if (roomUser != null && roomUser.getChannel() != channel) { + room.removeUser(roomUser); + roomUser = null; + } + + if (channelUser == null && roomUser == null) { + final ConferenceMemberImpl user; + // using the current date as dateJoined is not correct but we + // don't have anything that is better + user = new ConferenceMemberImpl(server, room, userNumber, channel, DateUtil.getDate()); + user.setMuted(muted); + user.setTalking(talking); + room.addUser(user); + channel.setMeetMeUserImpl(user); + server.fireNewMeetMeUser(user); + } else if (channelUser != null && roomUser == null) { + channelUser.setMuted(muted); + room.addUser(channelUser); + } else if (channelUser == null) { + roomUser.setMuted(muted); + channel.setMeetMeUserImpl(roomUser); + } else { + if (channelUser != roomUser) { + logger.error("Inconsistent state: channelUser != roomUser, channelUser=" + channelUser + ", roomUser=" + + roomUser); + } + } + */ + } +/* + Collection users = room.getUserImpls(); + Collection usersToRemove = new ArrayList(); + for (ConferenceMemberImpl user : users) { + if (!userNumbers.contains(user.getUserNumber())) { + // remove user as he is no longer in the room + usersToRemove.add(user); + } + } + + for (ConferenceMemberImpl user : usersToRemove) { + user.left(DateUtil.getDate()); + room.removeUser(user); + user.getChannel().setMeetMeUserImpl(null); + } + */ + } + public void onManagerEvent(ManagerEvent event) { // just print received events