Example #1
0
def fetch(host, port, salt):
    args = info_args(host, port, salt)
    result = BigBlueButtonInfo()

    meetings = bbb_api.getMeetings(args.url, args.salt)

    # just in case there are no meetings in the server
    if "meetings" in meetings and meetings["meetings"] != None:
        for name, meeting in meetings["meetings"].iteritems():

            # only if the meeting is running
            if re.match("true", meeting["running"], re.IGNORECASE):
                result.addMeeting()
                if "participantCount" in meeting:
                    result.addToUsers(int(meeting["participantCount"]))
                if "listenerCount" in meeting:
                    result.addToAudioUsers(int(meeting["listenerCount"]))
                if "videoCount" in meeting:
                    result.addToVideoUsers(int(meeting["videoCount"]))

    return result
Example #2
0
def fetch(host, port, salt):
    args = info_args(host, port, salt)
    result = BigBlueButtonInfo()

    meetings = bbb_api.getMeetings(args.url, args.salt)

    # just in case there are no meetings in the server
    if "meetings" in meetings and meetings["meetings"] != None:
        for name, meeting in meetings["meetings"].iteritems():

            # only if the meeting is running
            if re.match("true", meeting["running"], re.IGNORECASE):
                result.addMeeting()
                meeting_info = bbb_api.getMeetingInfo(meeting["meetingID"], meeting["moderatorPW"], args.url, args.salt)
                result.addToUsers(int(meeting_info["participantCount"]))

                if "listenerCount" in meeting_info:
                    result.addToAudioUsers(int(meeting_info["listenerCount"]))

                for uid, user in meeting_info["attendees"].iteritems():
                    if "hasVideoStream" in user and re.match("true", user["hasVideoStream"], re.IGNORECASE):
                        result.addVideoUser()

    return result