How can I set a participant limit for only some rooms?

In the system I set up, users create rooms and I manage access to these rooms via jwt with jitok. I also want to add participant limit feature to rooms. For example, while only two people can attend a meeting created by a student, I want 10 people to participate in the room created by the teacher. How can I manage this, how can I follow a path. Waiting for your ideas.
my jitsi version: docker-jitsi-meet-stable-7648-4
I installed it with Docker.

Setting max occupancy based on who joined first (since in Jitsi, room is created on first join) is going to be a little messy. Consider the case where teacher joins almost the same time as a student – the results will be unpredictable based on who clicks first. Or if a student joins first, then teacher – would you now need to change the max from 2 to 10? How about if teacher creates the room, then students join, then teacher leaves – should the max now be reduced from 10 to 2?

Perhaps an approach that might be simpler to reason about would be to set max occupancy based on subdomains? So:

  1. Use mod_max_occupant and set limit to 2. This will be the default limit.
  2. Create a custom prosody module that checks if room has a known subdomain and increase the limit (by setting accordingly e.g. if /teacher/<RoomName> then raise limit to 10, if /assembly/<roomName> then raise limit to 200 and so on.
  3. Set enable_domain_verification = true in prosody config. When this is set, then the ‘sub’ field in token has to match the subdomain, e.g. for /teacher/room123 the sub has to be “teacher” and room claim has to be “room123”.
  4. Now it’s down to how you issue JWT to determine who can create what room, with the subdomain of the room determining the max size.

There is now the per_room_max_occupants plugin to handle what I mentioned above.

In your case, you would set:

Component "" "muc"
  modules_enabled = {
    -- ... 

  muc_max_occupants = 2  -- default max occupants for all rooms
  muc_access_whitelist = { "" }  -- jicofo should be excluded from occupancy count

  max_occupants_for_subdomains = { 
    teacher = 10;  -- increase limit for "/teacher/*" rooms   

All that’s left is for you to make sure only teachers can create /teachers/* rooms.