IVR Scripts

Question Metadata Section

Question ID

Normal Question Identifier in 3 parts like 1.1.1. When creating a new question the system will give you the next available ID but you can change this to whatever you wish as long as it is not currently used.

Is this question part of a loop?

Should be self explanatory, a question can only be one of: - Not part of a loop - Starts a Loop - Part of a Loop - End a Loop

Loop Type

This setting doesn't currently have an effect on the product variables (i.e. combining dual fuel products) however you should set it to Product loop on the question that begins a loop as it is used to help the system know it is inside a loop.

Question Text Section

Read As

When a recording is not available control how the text to speech system reads the entered text.

  • Normal Text: reads the text normally and reads numbers like 12345 as twelve thousand three hundred fourty five
  • Number: spells out everything in the box. 12345 would be read as one two three four five. Also works for regular text for anything that needs to be spelled out.

Text Entry

This field automatically hydrates variables just like a regular script, i.e. {{client.name}}.

Segment Tools

Upload Recording

Allows to upload a recording of the text IN THIS SECTION ONLY. Accepted formats are mp3 and wav files. When a recording has been uploaded this button is removed and replaced with a player for that recording.

Remove Recording

Removes the recording from storage. If you have previously saved this script with the recording attached it is possible for Twilio to attempt to play the recording unless you save the question immediately after removing the recording.

Remove Segment

Removes the text segment and the associated recording if applicable.

Add Text Segment

Adds a new segment for configuration.

Resolution Section

This section determines how the question will reach resolution and where it will route the system next.

Resolution Type

  • Simple Input - Accepts single key presses and simple voice commands
  • Record Voice - Records the caller's voice

Simple Input Segments

Should the input prompt be read aloud everytime even if the prompts are repeated?

If set to no (the default) the input expectations section will only be read if the inputs defined are different than the last question. This does not affect the behaviour for bad input.

When Given

  • Numeric: the number 0 to 9 that will trigger this input selection
  • English & Spanish: the simple voice commands that will trigger this input. The system will expect this exact text so if you put multiple words the caller will have to say all of them. Single word responses are highly recommended.

Prompts

The text that will be read to tell the caller how to proceed. Variables are hydrated here. The system does not currently support recordings here so this will be text to speech. If the caller does not enter anything or gives an invalid response this portion will be repeated. English and Spanish languages are supported.

Store Response As

This is the value that will be stored in the databse (if selected.) The dropdown contains Yes and No as well as a custom value you can enter after selecting the custom option. You can also tell the system to not store a response with that option.

Action

This is where you control how this question will be resolved. Choices are: - Go To Question - Enter either a question id or a conditional to determine the next question. See the GOTO sections at the end of this document in the Additional Info section for examples. - Repeat Question - Repeats the entire question and the prompts. - End Call as Good Sale - End Call as No Sale - Enter a disposition reason in the box provided to have that selected if this option is chosen. The default option, if not provided here, is "Customer Changed Their Mind"

Record Voice Input Definition

This is a reduced version of the Simple Input Definition containing only the Prompts and Action sections. Prompts should mention a tone playing when the recording will begin. Recording can be stopped either by going silent or with the # key.

Exit Statements

When the call is ended as no sale the system will look for exit statements in this order: 1. The current question 2. The script configuration 3. The default: "Thank you, we have marked your enrollment as incomplete."

Additional Info

GOTO Simple Entry

For simply going to another question all that is needed in the box is the question id to go to, i.e. 1.12.1 etc.

GOTO Advanced Entry

Based on the IF directive in vscript. Other Vscript directives are not supported. The shortcut "^variable.name" is used instead of the LOOKUP directive. All LOOKUP variables available in Vscript should be available here. Please note that all loops are currently a single product so the .electric and .gas specifiers are unneeded and may cause issues.

Simple Example

{
  "IF": ["^product.type_raw","EQ","fixed"],
  "THEN": "1.12.1",
  "ELSE": "1.12.2"
}

More Complex Example

{
  "IF": [
      ["^product.type_raw","EQ","fixed"],
      "AND",
      ["^product.fuel_raw","EQ","electric"],
    ],
  "THEN": "1.12.1",
  "ELSE": "1.12.2"
}

Multiple Choices

{
  "IF": [
      ["^product.type_raw","EQ","fixed"],
      "AND",
      ["^product.fuel_raw","EQ","electric"],
    ],
  "THEN": "1.12.1",
  "ELSE-IF": [
      {
          "CASE": ["^product.type_raw","EQ","fixed"],
          "THEN": "1.12.3"
      },
      {
          "CASE": ["^product.type_raw","NE","fixed"],
          "THEN": "1.12.4"
      }
  ],
  "ELSE": "1.12.2"
}