Class StaticCallBehaviorCreator

java.lang.Object
com.sinch.sdk.domains.voice.models.v2.helpers.StaticCallBehaviorCreator

public final class StaticCallBehaviorCreator extends Object
Fluent creator of a STATIC service call behavior

Returned by CallBehaviorHelper.staticBehavior(SvamlCommand...).

Calling onHangup more than once appends the commands.

Since:
2.4
  • Method Details

    • name

      public StaticCallBehaviorCreator name(String name)
      Set the name of the call, sent as callName
      Parameters:
      name - Name of the call, 1 to 32 characters without spaces
      Returns:
      This creator
      Since:
      2.4
    • onHangup

      public StaticCallBehaviorCreator onHangup(SvamlCommand... commands)
      Add commands to run when the call is hung up
      Parameters:
      commands - Commands to append
      Returns:
      This creator
      Since:
      2.4
    • onHangup

      public StaticCallBehaviorCreator onHangup(Collection<? extends SvamlCommand> commands)
      Add commands to run when the call is hung up
      Parameters:
      commands - Commands to append
      Returns:
      This creator
      Since:
      2.4
    • onHangup

      Add commands to run when the call is hung up
      Parameters:
      sequence - Lambda adding the commands to append
      Returns:
      This creator
      Since:
      2.4
    • build

      public StaticCallBehavior build()
      Build the call behavior
      Returns:
      The STATIC call behavior
      Throws:
      IllegalStateException - if a gotoMenu command is outside a menu, or if a menu has a start menu or a gotoMenu target that is not one of its items
      Since:
      2.4