Avaya Client SDK

< Back to Package Overview

Moderator controls

Using the Avaya Client SDK, you can implement moderator controls for conferences. To use moderator controls, you must create and start a conference call (see the Developing Conferencing Applications page for details).

Become a moderator

The conference may provide an audio prompt to input the participant’s or moderator’s code to join the conference. The user can pass this information by sending DTMFs. To enter digits, call the sendDTMF method on the Call object.

call.sendDTMF(DTMF_digit);

To recognize whether a local participant is a moderator, use the getModerateConferenceCapability capability exposed by the Conference class.

boolean moderateConferenceCapability = call.getConference()
.getModerateConferenceCapability().isAllowed();
if (!moderateConferenceCapability) {
   Log.d(LOG_TAG, "Moderator controls are not available");
}

The moderator has full control of the conference and can assign roles to participants. The full list of moderator capabilities is available from the Conference class. For more details, see the Developing Conferencing Applications page.

Enable/disable the lecture mode

To check if the user can enable or disable the lecture mode, use the getUpdateLectureModeStatusCapability capability exposed by the Conference class.

boolean updatelectureModeCapability = call.getConference()
.getUpdateLectureModeStatusCapability().isAllowed();
if (!updatelectureModeCapability) {
   Log.d(LOG_TAG, "Lecture mode can't be changed");
}

To enable or disable the lecture mode, use the setLectureMode method and implement the CallCompletionHandler interface to obtain the result.

call.getConference().setLectureMode(isChecked, new CallCompletionHandler() {
    @Override
    public void onSuccess() {
        Log.d(LOG_TAG, "Successfully changed conference lecture mode");
    }

    @Override
    public void onError(CallException e) {
        Log.e(LOG_TAG, 
            "Failed to change conference lecture mode. Exception: " +
            e.getError());
    }
});

The ConferenceListener interface provides the onConferenceLectureModeStatusChanged callback notification. It can be used to determine if the lecture mode is enabled or disabled.

@Override
public void onConferenceLectureModeStatusChanged(Conference conference, 
                                                 boolean lectureModeStatus) {
    Log.d(LOG_TAG, "onConferenceLectureModeStatusChanged");
}

Mute all participants

The moderator can mute audio for all participants of the conference. To check if the mute all feature is allowed, use the getMuteAllParticipantsCapability capability exposed by the Conference class.

boolean muteAllParticipantsCapability = call.getConference()
.getMuteAllParticipantsCapability().isAllowed();
if (!muteAllParticipantsCapability) {
   Log.d(LOG_TAG, "Mute all is not available");
}

To mute all participants, use the muteAllParticipants method of the Conference object.

call.getConference().muteAllParticipants(new CallCompletionHandler() {
    @Override
    public void onSuccess() {
        Log.d(LOG_TAG, "Participants successfully muted");
    }

    @Override
    public void onError(CallException e) {
        Log.e(LOG_TAG, 
            "Failed to mute participants. Exception: " +
            e.getError());
    }
});

The ActiveParticipantListener listener provides the onParticipantAudioStatusChanged callback notification. It can be used to determine if the participant has been muted:

@Override
public void onParticipantAudioStatusChanged(Participant participant, 
ParticipantMediaStatus participantMediaStatus) {
    Log.d(LOG_TAG, "onParticipantAudioStatusChanged");
}