Enable lobby mode programatically

I have customized the frontend of Jitsi Meet. Now I want to programatically enable the lobby mode with an API call instead of using the provided button. What function/method do I have to use for this?

There is a toggleLobbyMode action you can dispatch.

Hi,

I am also looking for this solution I made modifications as per your suggestions but unfortunately I am not able to enable the lobby programatically. I made changes inside the constructor of conference.js which are following. Please guide what I am doing wrong.

    constructor(resolve, reject) {
        this._resolve = resolve;
        this._reject = reject;
        this.reconnectTimeout = null;
        room.on(JitsiConferenceEvents.CONFERENCE_JOINED,
            this._handleConferenceJoined.bind(this));
        APP.store.dispatch(toggleE2EE(true));
        APP.store.dispatch(toggleLobbyMode(true));

        room.on(JitsiConferenceEvents.CONFERENCE_FAILED,
            this._onConferenceFailed.bind(this));
    }