Class ConversationAction.Builder

java.lang.Object
com.vonage.client.voice.ncco.ConversationAction.Builder
Enclosing class:
ConversationAction

public static class ConversationAction.Builder extends Object
Builder for specifying the properties of a Conversation NCCO.
  • Method Details

    • name

      Sets the name of the Conversation room.
      Parameters:
      name - The conversation name.
      Returns:
      This builder.
    • musicOnHoldUrl

      Deprecated.
      This will be removed in the next major release.
      Parameters:
      musicOnHoldUrl - A URL to the mp3 file to stream to participants until the conversation starts. By default, the conversation starts when the first person calls the virtual number associated with your Voice app. To stream this mp3 before the moderator joins the conversation, set startOnEnter to false for all users other than the moderator.
      Returns:
      This builder.
    • musicOnHoldUrl

      public ConversationAction.Builder musicOnHoldUrl(String... musicOnHoldUrl)
      A URL to the mp3 file to stream to participants until the conversation starts. By default, the conversation starts when the first person calls the virtual number associated with your Voice app. To stream this mp3 before the moderator joins the conversation, set startOnEnter to false for all users other than the moderator.
      Parameters:
      musicOnHoldUrl - Absolute URL to the hold music in MP3 format, as a string.
      Returns:
      This builder.
    • startOnEnter

      The default value of true ensures that the conversation starts when this caller joins the conversation. Set to false for attendees in a moderated conversation.
      Parameters:
      startOnEnter - Whether to start the conversation when joining.
      Returns:
      This builder.
    • endOnExit

      For moderated conversations, set to true in the moderator NCCO so the conversation is ended when the moderator hangs up. The default value of false means the conversation is not terminated when a caller hangs up; the conversation ends when the last caller hangs up.
      Parameters:
      endOnExit - Whether to end the conversation when the moderator hangs up.
      Returns:
      This builder.
    • record

      Set to true to record this conversation. For standard conversations, recordings start when one or more attendees connects to the conversation. For moderated conversations, recordings start when the moderator joins. That is, when an NCCO is executed for the named conversation where startOnEnter is set to true. When the recording is terminated, the URL you download the recording from is sent to the event URL.

      By default, audio is recorded in MP3 format. See the recording guide for more details.

      Parameters:
      record - Whether to enable recording.
      Returns:
      This builder.
    • eventUrl

      Deprecated.
      This will be removed in the next major release.
      Parameters:
      eventUrl - Set the URL to the webhook endpoint Vonage calls asynchronously on each of the Call States.
      Returns:
      This builder.
    • eventUrl

      Set the URL to the webhook endpoint Vonage calls asynchronously on each of the Call States.
      Parameters:
      eventUrl - The event URL as a string.
      Returns:
      This builder.
    • eventMethod

      Set the HTTP method used to make the request to eventUrl. The default value is POST.
      Parameters:
      eventMethod - The event method as an enum.
      Returns:
      This builder.
    • mute

      public ConversationAction.Builder mute(boolean mute)
      Whether to mute the participant. The audio from the participant will not be played to the conversation and will not be recorded. When using canSpeak(Collection), the mute parameter is not supported.
      Parameters:
      mute - true to mute the participant.
      Returns:
      This builder.
      Since:
      8.2.0
    • addCanSpeak

      Convenience method for adding a leg ID to the canSpeak collection. The added leg ID will be able to hear this participant.
      Parameters:
      uuid - The participant leg ID to add as a string.
      Returns:
      This builder.
      Since:
      8.2.0
      See Also:
    • addCanHear

      Convenience method for adding a leg ID to the canHear collection. This participant will be able to hear the participant associated with the provided leg ID.
      Parameters:
      uuid - The participant leg ID to add as a string.
      Returns:
      This builder.
      Since:
      8.2.0
    • canSpeak

      A collection of leg UUIDs that this participant can be heard by. If not provided, the participant can be heard by everyone. If an empty collection is provided, the participant will not be heard by anyone. This will replace the current collection.
      Parameters:
      canSpeak - The leg UUIDs that can hear this participant speak.
      Returns:
      This builder.
      Since:
      8.2.0
      See Also:
    • canHear

      A collection of leg UUIDs that this participant can hear. If not provided, the participant can hear everyone. If an empty collection is provided, the participant will not hear any other participants. This will replace the current collection.
      Parameters:
      canHear - The leg UUIDs that this participant can hear.
      Returns:
      This builder.
      Since:
      8.2.0
      See Also:
    • transcription

      Transcription settings. If present (even if all settings are default), transcription is activated. The record(Boolean) parameter must be set to true.
      Parameters:
      transcription - The transcriptions settings.
      Returns:
      This builder.
      Since:
      8.2.0
    • build

      Builds the Conversation NCCO action.
      Returns:
      A new ConversationAction object from the stored builder options.