Mute All by default

I have a scenario where the moderator can speak but all participants join with mute audio and if they want to speak they should raise their hands and the moderator can allow them to speak.

Inside the Participant pane there is an option of Mute All and inside dialog moderator can uncheck the option “Allow attendees to unmute themselves” and press ok and good to go.
I wanted to add this functionality as soon as the moderator started the meeting without doing it from the participant pane.

I saw there is a function “muteAllParticipants” I called this function but no luck.
I am working on a source. Can somebody guide me how I can achieve this behaviour?

Inside conference.js I am hacking with a join event as shown below. By doing this all participants can join meetings without audio which is good but they should not unmute themselves until moderators allow and accept their request to unmute the mic.

 room.on(JitsiConferenceEvents.USER_ROLE_CHANGED, (id, role) => {[{ id }], MEDIA_TYPE.AUDIO));

        if (this.isLocalId(id)) {
  `My role changed, new role: ${role}`);

            if (role === 'moderator') {
                config.isHost = true;


            APP.API.notifyUserRoleChanged(id, role);
        } else {
  , role));