Plum Voice Resource Center

Cover all your bases for your voice automation project. Learn best practices, what's possible with Plum's products, how to do it, and more using our extensive resources.

Start Your Trial
Talk with Sales

Latest in the Blog

Solving the Alpha-Numeric Quandary for IVR

One of the best features of the telephone is its simplicity. You have ten digits to work with (plus the star and pound keys) and pretty much anyone over the age of four can make sense of basic phone concepts. While those ten digits make phone interactions simple, they also make it difficult to enter letter-based data. Sure, most of...

Code of the day

<form>

Forms are the key components of VoiceXML documents. A form contains:* A set of form items, elements that are visited in the main loop of the form interpretation algorithm. Form items are subdivided into input items that can be "filled" by user input and control items that cannot.* Declarations of non-form item variables.* Event handlers.* "Filled" actions, blocks of procedural logic that execute when certain combinations of input item variables are assigned.
<?xml version="1.0"?>
<vxml version="2.0">
  <form id="firstform">
    <block>
      <prompt>
        Welcome! Let's move to a form where we gather some input.
      </prompt>
      <!-- A "#" symbol followed by an identifier specifies a -->
      <!-- form or menu ID to jump to. -->
      <goto next="#thirdform"/>
    </block>
  </form>
  <form id="secondform">
    <block>
      <prompt>
        You've made it to the final form! Goodbye.
      </prompt>
      <disconnect/>
    </block>
  </form>
  <form id="thirdform">
    <field name="lucky_number" type="digits?length=1">
      <prompt>
        Enter your lucky number.
      </prompt>
      <filled>
        <prompt>
          Your lucky number is <value expr="lucky_number"/>. Let's move on to another form.
        </prompt>
        <goto next="#secondform"/>
      </filled>
      <catch event="nomatch noinput" count="1,2">
        <prompt>
          Your lucky number should be 1 digit. Let's try again.
        </prompt>
        <reprompt/>
      </catch>
      <catch event="nomatch noinput" count="3">
        <prompt>
          I guess you don't have a lucky number. Let's move on to the next form anyways.
        </prompt>
        <goto next="#secondform"/>
      </catch>
    </field>
  </form>
</vxml>