Class Menu
java.lang.Object
com.sinch.sdk.domains.voice.models.v2.helpers.Menu
Helpers to build the interactive menu SVAML commands
- Since:
- 2.4
-
Method Summary
Modifier and TypeMethodDescriptionstatic MenuCreatorRun an interactive menu that collects user input (e.g.static GotoMenuCommandJump to another item of the enclosing menustatic MenuItemitem(Consumer<MenuItemCreator> item) Create a menu item, e.g.static MenuPromptprompt(Consumer<PromptCreator> prompt) Create a menu prompt, e.g.
-
Method Details
-
create
Run an interactive menu that collects user input (e.g. DTMF digits)The sequence waits for the menu to end before running the next command.
- Parameters:
startMenu- Name of the item played first, 1 to 16 characters. It must be one of the items of the menu- Returns:
- The creator of the
menucommand - Since:
- 2.4
-
gotoMenu
Jump to another item of the enclosing menuOnly valid within a menu: in the
matchoronFailurecommands of an item, including their nested event handlers. The target must be an item of that menu.The target is checked when one of these is built: a menu (
MenuCreator), a sequence (CommandsSequenceCreator), a static call behavior or a response to an incoming call. Building another creator alone, e.g.DialCreator, does not check it.Named after the API command:
gotois a reserved word in Java.- Parameters:
name- Name of the menu item, 1 to 16 characters, sent asmenuName- Returns:
- The
gotoMenucommand - Since:
- 2.4
-
prompt
Create a menu prompt, e.g. to share it between several items or as repeat prompt- Parameters:
prompt- Lambda filling the prompt- Returns:
- The menu prompt
- Throws:
IllegalStateException- if the lambda adds no message- Since:
- 2.4
-
item
Create a menu item, e.g. to share it between several menusAdd it to a menu with
MenuCreator.item(String, MenuItem). ItsgotoMenutargets are checked when that menu is built.- Parameters:
item- Lambda filling the item- Returns:
- The menu item
- Since:
- 2.4
-