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 ModerateConferenceCapability capability exposed by the Conference class.

if (!call.Conference.ModerateConferenceCapability.Allowed) 
{
   PrintInfo("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 SetLectureModeStatusCapability capability exposed by the Conference class.

if (!call.Conference.SetLectureModeStatusCapability.Allowed) 
{
   PrintInfo("Lecture mode can't be changed");
}

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

Conference.ConferenceActionCompletionHandler completionHandler = (error) =>
{
    if (error == null)
    {
        PrintInfo("Successfully changed conference lecture mode.");
    }
    else
    {
        PrintError(String.Format(
            "Failed to change conference lecture mode: {0}",
            error.Error));
    }
};

call.Conference.SetLectureModeActive(isChecked, completionHandler);

The conference object provides the LectureModeStatusChanged callback notification that can be used to determine if the lecture mode is enabled or disabled.

call.Conference.LectureModeStatusChanged += 
    new EventHandler(onLectureModeStatusChanged);
...

void onLectureModeStatusChanged(object sender, ConferencePropertyEventArgs arg)
{
    Conference conference = (Conference)sender;
    if (arg.Enabled)
        PrintInfo("Lecturemode enabled");
    else
        PrintInfo("Lecturemode disabled");
}

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 MuteAllParticipantsCapability capability exposed by the Conference class.

if (!call.Conference.MuteAllParticipantsCapability.Allowed) 
{
   PrintInfo("Mute all is not available");
}

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

Conference.ConferenceActionCompletionHandler completionHandler = (error) =>
{
    if (error == null)
    {
        PrintInfo("Participants successfully muted");
    }
    else
    {
        PrintError(String.Format(
        "Failed to mute participants: {0}", error.Error));
    }
};

call.Conference.MuteAllParticipants(completionHandler);

The ActiveParticipant object provides the AudioStatusChanged notification. It can be used to determine if the participant has been muted:

participant.AudioStatusChanged += 
   new EventHandler(onParticipantAudioStatusChanged);
...

void onParticipantAudioStatusChanged(object sender, ParticipantMediaEventArgs e)
{
    ActiveParticipant participant = (ActiveParticipant)sender;
    PrintInfo(String.Format("{0} participant audio status changed to {1}.", 
    participant.Address, e.MediaStatus));
}