Skip to content

Commit

Permalink
Merge branch 'master' of github.com:bigbluebutton/bigbluebutton
Browse files Browse the repository at this point in the history
  • Loading branch information
ffdixon committed Apr 4, 2012
2 parents 36c701e + 323a4f4 commit 50bd44c
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 8 deletions.
47 changes: 47 additions & 0 deletions bbb-api-demo/src/main/webapp/bbb_api.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -695,4 +695,51 @@ public static String urlEncode(String s) {
}
return "";
}
public String getMeetingsWithoutPasswords() {
try {
Document doc = parseXml( getURL( getMeetingsURL() ));
// tags needed for parsing xml documents
final String startTag = "<meetings>";
final String endTag = "</meetings>";
final String startResponse = "<response>";
final String endResponse = "</response>";
// if the request succeeded, then calculate the checksum of each meeting and insert it into the document
NodeList meetingsList = doc.getElementsByTagName("meeting");
String newXMldocument = startTag;
for (int i = 0; i < meetingsList.getLength(); i++) {
Element meeting = (Element) meetingsList.item(i);
String meetingID = meeting.getElementsByTagName("meetingID").item(0).getTextContent();
String password = meeting.getElementsByTagName("moderatorPW").item(0).getTextContent();
String data = getURL( getMeetingInfoURL(meetingID, password) );
if (data.indexOf("<response>") != -1) {
data = removeTag(data, "<attendeePW>", "</attendeePW>");
data = removeTag(data, "<moderatorPW>", "</moderatorPW>");
int startIndex = data.indexOf(startResponse) + startResponse.length();
int endIndex = data.indexOf(endResponse);
newXMldocument += "<meeting>" + data.substring(startIndex, endIndex) + "</meeting>";
}
}
newXMldocument += endTag;
return newXMldocument;
} catch (Exception e) {
e.printStackTrace(System.out);
return null;
}
}
public static String removeTag(String data, String startTag, String endTag){
int startIndex = data.indexOf(startTag);
int endIndex = data.indexOf(endTag) + endTag.length();
String tagStr = data.substring(startIndex, endIndex);
return data.replace(tagStr,"");
}
%>
2 changes: 1 addition & 1 deletion bbb-api-demo/src/main/webapp/demo4_helper.jsp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" ?>
<%= getMeetings() %>
<%= getMeetingsWithoutPasswords() %>
<%@ include file="bbb_api.jsp" %>
<%@ page contentType="text/xml" %>

Expand Down
5 changes: 5 additions & 0 deletions bigbluebutton-web/grails-app/conf/bigbluebutton.properties
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ defaultMeetingExpireDuration=1
# removed from memory.
defaultMeetingCreateJoinDuration=5

# Disable recording by default.
# true - don't record even if record param in the api call is set to record
# false - when record param is passed from api, override this default
disableRecordingDefault=false

#----------------------------------------------------
# This URL is where the BBB client is accessible. When a user sucessfully
# enters a name and password, she is redirected here to load the client.
Expand Down
1 change: 1 addition & 0 deletions bigbluebutton-web/grails-app/conf/spring/resources.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
<property name="defaultNumDigitsForTelVoice" value="${defaultNumDigitsForTelVoice}"/>
<property name="defaultClientUrl" value="${defaultClientUrl}"/>
<property name="defaultMeetingDuration" value="${defaultMeetingDuration}"/>
<property name="disableRecordingDefault" value="${disableRecordingDefault}"/>
</bean>

<import resource="doc-conversion.xml" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ public class ParamsProcessorUtil {
private int defaultNumDigitsForTelVoice;
private String defaultClientUrl;
private int defaultMeetingDuration;

private boolean disableRecordingDefault;

private String substituteKeywords(String message, String dialNumber, String telVoice, String meetingName) {
String welcomeMessage = message;

Expand Down Expand Up @@ -352,6 +353,12 @@ public String processLogoutUrl(String logoutUrl) {
}

public boolean processRecordMeeting(String record) {
// The administrator has turned off recording for all meetings.
if (disableRecordingDefault) {
log.info("Recording is turned OFF by default.");
return false;
}

boolean rec = false;
if(! StringUtils.isEmpty(record)){
try {
Expand Down Expand Up @@ -483,6 +490,10 @@ public void setDefaultClientUrl(String defaultClientUrl) {
public void setDefaultMeetingDuration(int defaultMeetingDuration) {
this.defaultMeetingDuration = defaultMeetingDuration;
}

public void setDisableRecordingDefault(boolean disabled) {
this.disableRecordingDefault = disabled;
}

public ArrayList<String> decodeIds(String encodeid){
ArrayList<String> ids=new ArrayList<String>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ public class BlockStreamEventMessageHandler extends IoHandlerAdapter {

private ISessionManagerGateway sessionManager;

@Override
public void exceptionCaught( IoSession session, Throwable cause ) throws Exception
{
log.warn(cause.toString() + " \n " + cause.getMessage());
cause.printStackTrace();
}
// @Override
// public void exceptionCaught( IoSession session, Throwable cause ) throws Exception
// {
// log.warn(cause.toString() + " \n " + cause.getMessage());
// cause.printStackTrace();
// }

@Override
public void messageReceived( IoSession session, Object message ) throws Exception
Expand Down

0 comments on commit 50bd44c

Please sign in to comment.