diff --git a/bigbluebutton-web/grails-app/conf/UrlMappings.groovy b/bigbluebutton-web/grails-app/conf/UrlMappings.groovy index b778fa5b38..1ab70ed2f9 100755 --- a/bigbluebutton-web/grails-app/conf/UrlMappings.groovy +++ b/bigbluebutton-web/grails-app/conf/UrlMappings.groovy @@ -41,6 +41,14 @@ class UrlMappings { action = [POST:'setPollXML'] } + "/api/getMeetings"(controller:"api") { + action = [GET:'getMeetingsHandler'] + } + + "/api/getRecordings"(controller:"api") { + action = [GET:'getRecordingsHandler'] + } + "/$controller/$action?/$id?(.${format})?"{ constraints { // apply constraints here diff --git a/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy b/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy index f8931acf5c..7711064d7a 100755 --- a/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy +++ b/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy @@ -678,10 +678,12 @@ class ApiController { /************************************ * GETMEETINGS API ************************************/ - def getMeetings = { + def getMeetingsHandler = { String API_CALL = "getMeetings" log.debug CONTROLLER_NAME + "#${API_CALL}" + println("##### GETMEETINGS API CALL ####") + // BEGIN - backward compatibility if (StringUtils.isEmpty(params.checksum)) { invalid("checksumError", "You did not pass the checksum security check") @@ -708,7 +710,7 @@ class ApiController { // Do we agree on the checksum? If not, complain. if (! paramsProcessorUtil.isChecksumSame(API_CALL, params.checksum, request.getQueryString())) { - errors.checksumError() + errors.checksumError() respondWithErrors(errors) return } @@ -722,37 +724,37 @@ class ApiController { render(contentType:"text/xml") { response() { returncode(RESP_CODE_SUCCESS) - meetings(null) + meetings() messageKey("noMeetings") message("no meetings were found on this server") } } } } - return; - } - - response.addHeader("Cache-Control", "no-cache") - withFormat { - xml { - render(contentType:"text/xml") { - response() { - returncode(RESP_CODE_SUCCESS) - meetings() { - mtgs.each { m -> - meeting() { - meetingID(m.getExternalId()) - meetingName(m.getName()) - createTime(m.getCreateTime()) - attendeePW(m.getViewerPassword()) - moderatorPW(m.getModeratorPassword()) - hasBeenForciblyEnded(m.isForciblyEnded() ? "true" : "false") - running(m.isRunning() ? "true" : "false") + } else { + println("#### Has running meetings [" + mtgs.size() + "] #####") + response.addHeader("Cache-Control", "no-cache") + withFormat { + xml { + render(contentType:"text/xml") { + response() { + returncode(RESP_CODE_SUCCESS) + meetings { + for (m in mtgs) { + meeting { + meetingID(m.getExternalId()) + meetingName(m.getName()) + createTime(m.getCreateTime()) + attendeePW(m.getViewerPassword()) + moderatorPW(m.getModeratorPassword()) + hasBeenForciblyEnded(m.isForciblyEnded() ? "true" : "false") + running(m.isRunning() ? "true" : "false") + } + } } } } } - } } } } @@ -1415,7 +1417,7 @@ class ApiController { /****************************************************** * GET_RECORDINGS API ******************************************************/ - def getRecordings = { + def getRecordingsHandler = { String API_CALL = "getRecordings" log.debug CONTROLLER_NAME + "#${API_CALL}"