Looking for a way to find if any meeting is running without auth

82 views
Skip to first unread message

Clément Gineste

unread,
Apr 11, 2024, 12:17:18 PM4/11/24
to BigBlueButton-dev
Hello,

I'm looking for a way to know if any meeting is running without authentication (API or not). I have no other solution than to use the API's getMeetings method to get this information, but then I need to generate the checksum.
For the sake of simplicity, I prefer not to manage secrets. Even more so if I have to manage a large number of servers. In this case, I'd prefer a common secret to fetch only this information and not have access to the rest of the API methods.
The final goal is to offer a server autoscalling feature, so that if no meeting is detected at a certain time, we can reduce server power (cloud provider compute) to optimize billing.

Cheers,

Clément

DistanceLearning.cloud

unread,
Apr 11, 2024, 2:05:48 PM4/11/24
to BigBlueButton-dev
for scaling your loadbalancer should know if meeting is running, and if server had no meeting, so you can turn off...

you can also use bbb-webhooks, and have each bbb server send your app any event,  like meeting started, ends, user x joined, etc..     you can ingest all of the server events into your solution,  with the need to never ping a server..

regards,
Stephen

Clément Gineste

unread,
Apr 11, 2024, 3:53:54 PM4/11/24
to BigBlueButton-dev
Le jeudi 11 avril 2024 à 20:05:48 UTC+2, DistanceLearning.cloud a écrit :
for scaling your loadbalancer should know if meeting is running, and if server had no meeting, so you can turn off...
 That's the point, if `getMeetings` responds with `noMeetings` I can reduce the size of the server. But I didn't want to use authentication, but I guess I have no choice but to manage a dict with secrets for each bbb server.

you can also use bbb-webhooks, and have each bbb server send your app any event,  like meeting started, ends, user x joined, etc..     you can ingest all of the server events into your solution,  with the need to never ping a server..
 
I'd forgotten about webhooks, thanks for the reminder but I won't be using it that way but I'll keep it in mind for future developments.

DistanceLearning.cloud

unread,
Apr 11, 2024, 4:29:46 PM4/11/24
to BigBlueButton-dev
if you install bbb-webhooks on every server, and point to a single endpoint you have,  all the events from all the servers "that you care about" are pushed to you  :)

Clément Gineste

unread,
Apr 11, 2024, 4:56:34 PM4/11/24
to BigBlueButton-dev
I know... But I haven't spotted a "tell the world I no longer have a meeting" event. I think I could do something with the "meetingcreated" event and the "meetingfinished" (or something like that) but that means I have to manage a message queue and that's not the way I was thinking of doing it.

I'm about to do it using python3, dict for the server configuration served by a github actions secret and a cron configuration for the auto-call script running via github actions.

Am I missing something?

Honestly, I'd rather just request the API for any meeting in progress without authentication. I don't know how complicated it is to add such a function, I'm a java/grails noob.

DistanceLearning.cloud

unread,
Apr 12, 2024, 7:00:23 AM4/12/24
to BigBlueButton-dev
users=$(mongo --quiet mongodb://127.0.1.1:27017/meteor --eval "db.users.count({loggedOut:false})")
meetings=$(mongo --quiet mongodb://127.0.1.1:27017/meteor --eval "db.meetings.find()" | grep "meetingEnded\" : false," | wc -l)

this on 2.X not on upcoming 3.0 can return meeting and user info... in 3.0 will be postgres table

so if you expose mongo db port to your monitor app...  it can get this anytime.  without going thru bbb-web and checksums.

regards,
Stephen

Clément Gineste

unread,
Apr 16, 2024, 10:12:25 AM4/16/24
to BigBlueButton-dev
That's a nice idea, but since it'll be drop in 3.x :'(

I am finaly using a simple function in python :

# Function to check whether BBB is in use
def is_bbb_used(bbb_url, bbb_secret):
api_call = "getMeetings"
query_string = urllib.parse.urlencode({"random": datetime.datetime.now().timestamp()})
checksum = generate_checksum(api_call, query_string, bbb_secret)
url = f"{bbb_url}/api/{api_call}?{query_string}&checksum={checksum}"
try:
response = requests.get(url)
if "<returncode>SUCCESS</returncode>" in response.text and "<messageKey>noMeetings</messageKey>" in response.text:
return False
else:
return True
except:
print(f"Error when checking the use of BBB for {bbb_url}")
return True
raise


Where `bbb_url` and `bbb_secret`are outputs from `bbb-conf --secret`

Reply all
Reply to author
Forward
0 new messages