Skip to content

Commit 7c4326a

Browse files
committed
- make bbb start on red5 r4582
1 parent 3868f59 commit 7c4326a

File tree

7 files changed

+115
-225
lines changed

7 files changed

+115
-225
lines changed

bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/BigBlueButtonApplication.java

Lines changed: 46 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import org.red5.logging.Red5LoggerFactory;
2626
import org.red5.server.adapter.IApplication;
2727
import org.red5.server.adapter.MultiThreadedApplicationAdapter;
28+
import org.red5.server.api.IClient;
2829
import org.red5.server.api.IConnection;
2930
import org.red5.server.api.IContext;
3031
import org.red5.server.api.scope.IScope;
@@ -40,18 +41,52 @@ public class BigBlueButtonApplication extends MultiThreadedApplicationAdapter {
4041
private RecorderApplication recorderApplication;
4142
private AbstractApplicationContext appCtx;
4243
private ConnectionInvokerService connInvokerService;
43-
44+
45+
@Override
46+
public boolean appConnect(IConnection conn, Object[] params) {
47+
log.debug("appConnect");
48+
return true;
49+
}
50+
51+
@Override
52+
public void appDisconnect(IConnection conn) {
53+
log.debug("appDisconnect");
54+
}
55+
56+
@Override
57+
public boolean appJoin(IClient client, IScope scope) {
58+
log.debug("appJoin: " + scope.getName());
59+
return true;
60+
}
61+
62+
@Override
63+
public void appLeave(IClient client, IScope scope) {
64+
log.debug("appLeave: " + scope.getName());
65+
}
66+
67+
@Override
68+
public boolean roomJoin(IClient client, IScope scope) {
69+
log.debug("roomJoin " + scope.getName(), scope.getParent().getName());
70+
return true;
71+
}
72+
73+
@Override
74+
public void roomLeave(IClient client, IScope scope) {
75+
log.debug("roomLeave: " + scope.getName());
76+
}
77+
4478
@Override
4579
public boolean appStart(IScope app) {
4680
log.debug("Starting BigBlueButton ");
4781
IContext context = app.getContext();
4882
appCtx = (AbstractApplicationContext) context.getApplicationContext();
4983
appCtx.addApplicationListener(new ShutdownHookListener());
5084
appCtx.registerShutdownHook();
85+
super.appStart(app);
5186

5287
connInvokerService.start();
5388

54-
return super.appStart(app);
89+
return true;
5590
}
5691

5792
@Override
@@ -65,8 +100,10 @@ public void appStop(IScope app) {
65100
public boolean roomStart(IScope room) {
66101
log.debug("Starting room [" + room.getName() + "].");
67102
assert participantsApplication != null;
103+
super.roomStart(room);
104+
68105
connInvokerService.addScope(room.getName(), room);
69-
return super.roomStart(room);
106+
return true;
70107
}
71108

72109
@Override
@@ -117,10 +154,13 @@ boolean record = (Boolean)params[5];
117154
"session=" + sessionName + ",voiceConf=" + voiceBridge + ",room=" + room + ",externalUserid=" + externalUserID;
118155
log.debug("User [{}] connected to room [{}]", debugInfo, room);
119156
participantsApplication.createRoom(room);
120-
super.roomConnect(connection, params);
121-
157+
158+
super.roomConnect(connection, params);
159+
122160
connInvokerService.addConnection(bbbSession.getInternalUserID(), connection);
123-
return true;
161+
162+
return true;
163+
124164
}
125165

126166
@Override

bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/chat/ChatHandler.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,7 @@ public boolean appStart(IScope scope) {
6969
public void appStop(IScope scope) {
7070
log.debug("appStop: " + scope.getName());
7171
}
72-
73-
@Override
74-
public boolean roomConnect(IConnection connection, Object[] params) {
75-
ChatEventRecorder recorder = new ChatEventRecorder(connection.getScope().getName(), recorderApplication);
76-
chatApplication.addRoomListener(connection.getScope().getName(), recorder);
77-
78-
return true;
79-
}
80-
72+
8173
@Override
8274
public void roomDisconnect(IConnection connection) {
8375
log.debug("roomDisconnect");
@@ -94,6 +86,14 @@ public void roomLeave(IClient client, IScope scope) {
9486
log.debug("roomLeave: " + scope.getName());
9587
}
9688

89+
@Override
90+
public boolean roomConnect(IConnection connection, Object[] params) {
91+
ChatEventRecorder recorder = new ChatEventRecorder(connection.getScope().getName(), recorderApplication);
92+
chatApplication.addRoomListener(connection.getScope().getName(), recorder);
93+
94+
return true;
95+
}
96+
9797
@Override
9898
public boolean roomStart(IScope scope) {
9999
log.debug("roomStart " + scope.getName());

bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/layout/LayoutHandler.java

Lines changed: 27 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import org.red5.server.adapter.IApplication;
2424
import org.red5.server.api.IClient;
2525
import org.red5.server.api.IConnection;
26-
import org.red5.server.api.Red5;
2726
import org.red5.server.api.scope.IScope;
2827
import org.red5.server.api.so.ISharedObject;
2928
import org.slf4j.Logger;
@@ -38,74 +37,64 @@ public class LayoutHandler extends ApplicationAdapter implements IApplication {
3837

3938
@Override
4039
public boolean appConnect(IConnection conn, Object[] params) {
41-
log.debug(APP + ":appConnect");
40+
log.debug("appConnect");
4241
return true;
4342
}
4443

4544
@Override
4645
public void appDisconnect(IConnection conn) {
47-
log.debug( APP + ":appDisconnect");
46+
log.debug("appDisconnect");
4847
}
4948

5049
@Override
5150
public boolean appJoin(IClient client, IScope scope) {
52-
log.debug( APP + ":appJoin " + scope.getName());
51+
log.debug("appJoin: " + scope.getName());
5352
return true;
5453
}
5554

5655
@Override
5756
public void appLeave(IClient client, IScope scope) {
58-
log.debug(APP + ":appLeave " + scope.getName());
57+
log.debug("appLeave: " + scope.getName());
5958
}
6059

6160
@Override
6261
public boolean appStart(IScope scope) {
63-
log.debug(APP + ":appStart " + scope.getName());
62+
this.scope = scope;
63+
log.debug("appStart: " + scope.getName());
6464
return true;
6565
}
6666

6767
@Override
6868
public void appStop(IScope scope) {
69-
log.debug(APP + ":appStop " + scope.getName());
69+
log.debug("appStop: " + scope.getName());
7070
}
71-
72-
@Override
73-
public boolean roomConnect(IConnection connection, Object[] params) {
74-
log.debug(APP + ":roomConnect");
75-
76-
IScope scope = Red5.getConnectionLocal().getScope();
77-
78-
if (!hasSharedObject(scope, LAYOUT_SO)) {
79-
if (createSharedObject(scope, LAYOUT_SO, false)) {
80-
ISharedObject so = getSharedObject(connection.getScope(), LAYOUT_SO);
81-
log.debug("Setting up Listener");
82-
LayoutSender sender = new LayoutSender(so);
83-
String room = connection.getScope().getName();
84-
log.debug("Adding event listener to " + room);
85-
log.debug("Adding room listener");
86-
layoutApplication.addRoomListener(room, sender);
87-
log.debug("Done setting up listener");
88-
return true;
89-
}
90-
}
91-
92-
return false;
93-
}
94-
71+
9572
@Override
9673
public void roomDisconnect(IConnection connection) {
97-
log.debug(APP + ":roomDisconnect");
74+
log.debug("roomDisconnect");
9875
}
9976

10077
@Override
10178
public boolean roomJoin(IClient client, IScope scope) {
102-
log.debug(APP + ":roomJoin " + scope.getName() + " - " + scope.getParent().getName());
79+
log.debug("roomJoin " + scope.getName(), scope.getParent().getName());
10380
return true;
10481
}
105-
82+
10683
@Override
107-
public void roomLeave(IClient client, IScope scope) {
108-
log.debug(APP + ":roomLeave " + scope.getName());
84+
public boolean roomConnect(IConnection connection, Object[] params) {
85+
System.out.println("********* " + APP + ":roomConnect");
86+
87+
log.debug(APP + ":roomConnect");
88+
89+
ISharedObject so = getSharedObject(connection.getScope(), LAYOUT_SO);
90+
log.debug("Setting up Listener");
91+
LayoutSender sender = new LayoutSender(so);
92+
String room = connection.getScope().getName();
93+
log.debug("Adding event listener to " + room);
94+
log.debug("Adding room listener");
95+
layoutApplication.addRoomListener(room, sender);
96+
log.debug("Done setting up listener");
97+
return true;
10998
}
11099

111100
@Override
@@ -126,6 +115,8 @@ public void roomStop(IScope scope) {
126115
}
127116

128117
public void setLayoutApplication(LayoutApplication a) {
118+
System.out.println("****** Setting layout application ********");
119+
129120
log.debug("Setting layout application");
130121
layoutApplication = a;
131122
layoutApplication.handler = this;

bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/participants/ParticipantsHandler.java

Lines changed: 23 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -43,62 +43,57 @@ public class ParticipantsHandler extends ApplicationAdapter implements IApplicat
4343

4444
@Override
4545
public boolean appConnect(IConnection conn, Object[] params) {
46-
log.debug(APP + ":appConnect");
46+
log.debug("appConnect");
4747
return true;
4848
}
4949

5050
@Override
5151
public void appDisconnect(IConnection conn) {
52-
log.debug( APP + ":appDisconnect");
52+
log.debug("appDisconnect");
5353
}
5454

5555
@Override
5656
public boolean appJoin(IClient client, IScope scope) {
57-
log.debug( APP + ":appJoin " + scope.getName());
57+
log.debug("appJoin: " + scope.getName());
5858
return true;
5959
}
6060

6161
@Override
6262
public void appLeave(IClient client, IScope scope) {
63-
log.debug(APP + ":appLeave " + scope.getName());
63+
log.debug("appLeave: " + scope.getName());
6464
}
6565

6666
@Override
6767
public boolean appStart(IScope scope) {
68-
log.debug(APP + ":appStart " + scope.getName());
68+
this.scope = scope;
69+
log.debug("appStart: " + scope.getName());
6970
return true;
7071
}
7172

7273
@Override
7374
public void appStop(IScope scope) {
74-
log.debug(APP + ":appStop " + scope.getName());
75+
log.debug("appStop: " + scope.getName());
7576
}
76-
77+
78+
@Override
79+
public boolean roomStart(IScope scope) {
80+
return true;
81+
}
82+
7783
@Override
7884
public boolean roomConnect(IConnection connection, Object[] params) {
7985
log.debug(APP + ":roomConnect");
80-
81-
IScope scope = Red5.getConnectionLocal().getScope();
82-
83-
if (!hasSharedObject(scope, PARTICIPANTS_SO)) {
84-
if (createSharedObject(scope, PARTICIPANTS_SO, false)) {
85-
ISharedObject so = getSharedObject(connection.getScope(), PARTICIPANTS_SO);
86-
ParticipantsEventSender sender = new ParticipantsEventSender(so);
87-
ParticipantsEventRecorder recorder = new ParticipantsEventRecorder(connection.getScope().getName(), recorderApplication);
86+
87+
ISharedObject so = getSharedObject(connection.getScope(), PARTICIPANTS_SO);
88+
ParticipantsEventSender sender = new ParticipantsEventSender(so);
89+
ParticipantsEventRecorder recorder = new ParticipantsEventRecorder(connection.getScope().getName(), recorderApplication);
8890

89-
log.debug("Adding room listener " + connection.getScope().getName());
90-
participantsApplication.addRoomListener(connection.getScope().getName(), recorder);
91-
participantsApplication.addRoomListener(connection.getScope().getName(), sender);
92-
log.debug("Done setting up recorder and listener");
93-
}
94-
}
95-
96-
return false;
97-
}
98-
99-
@Override
100-
public void roomDisconnect(IConnection connection) {
101-
log.debug(APP + ":roomDisconnect");
91+
log.debug("Adding room listener " + connection.getScope().getName());
92+
participantsApplication.addRoomListener(connection.getScope().getName(), recorder);
93+
participantsApplication.addRoomListener(connection.getScope().getName(), sender);
94+
log.debug("Done setting up recorder and listener");
95+
96+
return true;
10297
}
10398

10499
@Override
@@ -119,12 +114,6 @@ public void roomLeave(IClient client, IScope scope) {
119114
}
120115
}
121116

122-
@Override
123-
public boolean roomStart(IScope scope) {
124-
log.debug(APP + " - roomStart "+scope.getName());
125-
return true;
126-
}
127-
128117
@Override
129118
public void roomStop(IScope scope) {
130119
log.debug(APP + ":roomStop " + scope.getName());

0 commit comments

Comments
 (0)