CallXML 3.0 Development GuideHome  |  Frameset Home


<inputdigits>  element

<inputDigits> is an element that combines the functionality and attributes of a <block> element, <playAudio> element, and a <getDigits> element. The intent of this element is to foster easy creation of scripts which prompt the user to enter variable DTMF digits such as pin codes, pager messages, and numeric values. In the examples below, the user has 15 seconds to enter up to 4 digits (possibly for a PIN code), with a pause of no more than 5 seconds between keystrokes. Either the # or * key will end the input process, and the audio message/prompt will loop 3 times before dropping out of the element (i.e., timing out), and proceeding to the rest of the CallXML actions.

Only event handler tags for the possible events listed below can exist inside this tag. Any other tags found will result in an error.


usage
<inputdigits cache="(yes|no)" cleardigits="(true|false)" format="URI" id="(element id)" includetermdigit="(true|false)" label="(navigation identifier)" maxdigits="(numeric value)" maxsilence="(m|s|ms)" maxtime="(m|s|ms)" next="(navigation identifier)" repeat="(numeric value)" say="STRING" termdigits="(123456789*#|ABCD)" test="CDATA" value="URI" value-is="STRING" value-is-not="STRING" var="(variable name)">


attributes
cacheData Type: (yes|no)Default: none - attribute is optional
Allows manual override over the caching mechanism. If this attribute is empty the default system caching is used. "yes" should force the system to use the cache all the time, "no" means that no cache should be used at all.
cleardigitsData Type: (true|false)Default: none - attribute is optional
This attribute's value is a Boolean, indicating whether the queued digits buffer should be cleared when this action starts. "true" clears the digits buffer; "false" leaves the contents of the digit buffer alone.
formatData Type: URIDefault: none - attribute is optional
The 'format' attribute defines the string  formatting to use for the element.  If the value is undefined, the audio file format should be determined from the file name extension, if possible, and, if necessary, override the default format.
idData Type: (element id)Default: none - attribute is optional
The new 'id' attribute in CallXML3.0 is applicable to all container and action elements. Specifying this attribute allows yet another level of control and event handling when events occur and are caught by the <on> element. When an event occurs, the handler will first check the event, and then verify that the handler has a handler specific to the 'id' attribute to execute. This allows the developer to plan a specific course of action for events based on where in the application that they occur.
includetermdigitData Type: (true|false)Default: none - attribute is optional
This attribute defines whether the terminating digit should be included with the collected digit string. A value of 'true' indicates that the terminating digit will be appended to the string, and 'false' will ensure that the terminating digit pressed by the caller will not be included in the string.
labelData Type: (navigation identifier)Default: none - attribute is optional
This attribute designates the unique inter-document identifier of the parent element in question, and allows an easy way to navigate through applications as a destination 'anchor', as used in goto references
maxdigitsData Type: (numeric value)Default: none - attribute is optional
This attribute denoted the maximum number of digits to collect from the caller. When the maximum amount of digits has been reached, application execution will resume from within the <onmaxdigits> handler, if present.
maxsilenceData Type: (m|s|ms)Default: 5s
This attribute specifies the maximum time to wait between keypresses before a executing any repeat actions, if specified. The time string format is:
<numeric value>[<optional qualifier>] | nolimit

The string begins with a required numeric value. The valid qualifiers are:
  • m: minutes
  • s: seconds (default)
  • ms: milliseconds

Example: "45m 33s 117ms"

Note that if no qualifier is specified, an "s" qualifier is assumed. No combinations of qualifiers are allowed. If there is a need to specify an unlimited amount of time, simply use the key word "nolimit".
maxtimeData Type: (m|s|ms)Default: 30s
The maxtime attribute indicates the maximum time that the CallXML browser should wait for digits before executing any repeat instances, if present.
nextData Type: (navigation identifier)Default: none - attribute is optional
The 'next' attribute sets the URL the CallXML platform will go to when the container ends.
repeatData Type: (numeric value)Default: 1
The value for the repeat attribute indicates the number of times to execute the content contained by the parent element. If this attribute is explicitly specified, this must be a valid number, or an error will result.  Also note that if the value is zero the content will be skipped.
sayData Type: STRINGDefault: none - attribute is optional
The 'say' attribute allows the developer to specify backup TTS to be output in the event that the .wav file cannot be found.
termdigitsData Type: (123456789*#|ABCD)Default: none - attribute is optional
This attribute holds the list of touch-tone digits which can terminate the current caller action. Note that for each termdigit specified, there should be an <ontermdigit> handler in the code to catch the event. Allowable values are any one of "012356789*#", the ordinary DTMF (Touch-Tone) keypad possibilities, plus the special keypad tones found on some telephones "ABCD".
testData Type: CDATADefault: Optional
The 'test' attribute is a new supplement to the CallXML markup that permits the developer to execute the contents of a container element, or action element, based on whether or not the specified condition is met. If the defined condition is met, then the code contained within the element is then executed. If the condition is not met, then the application resumes execution with the next sequential container container element in the document.
valueData Type: URIDefault: none - attribute is required
The 'value' attribute defines the audio file to play to the caller when the parent element is first entered.
value-isData Type: STRINGDefault: none - attribute is optional
Another new attribute, 'value-is', grants the developer with the ability to perform conditional logic upon container elements, or action elements for the first time within the CallXML markup. The value specified in the 'value-is' attribute specifies a string to compare against any 'value' attributes. If the 'value' and 'value-is' equate to 'true', then the element specified will execute. If the value equates to 'false' then the element will be skipped during document execution.
value-is-notData Type: STRINGDefault: none - attribute is optional
Another new attribute, 'value-is-not', grants the developer with the ability to perform conditional logic upon container elements, or action elements, for the first time within the CallXML markup. The value specified in the 'value-is-not' attribute specifies a string to compare against any 'value' attributes. If the 'value' and 'value-is-not' equate to 'false', then the element specified will execute. If the value equates to 'true' then the element will be skipped during document execution.
varData Type: (variable name)Default: none - attribute is required
This defines the variable name in which to store the digits collected. Not specifying a value for this attribute will cause a fatal application error.



code samples
<3.0 inputdigits label-value-var-maxdigits>
<?xml version="1.0" encoding="UTF-8"?>

<callxml version="3.0">
  <do label="B1">
    <prompt>
      Here, we can input digits until our heart is content.
      Or until we press a total of three, whichever come first.
    </prompt>
    <goto value="#Dig_1"/>
  </do>

  <inputdigits label="Dig_1" value="MyIntro.wav" var="Dig_Var" maxdigits="3"/>


  <on event="maxdigits">
    <prompt>
      You must have pressed three digits, which equates to $Dig_Var; .
    </prompt>
  </on>

</callxml>


<3.0 inputdigits repeat-cache-maxsilence>
<?xml version="1.0" encoding="UTF-8"?>

<callxml version="3.0">
<do label="B1">
    <prompt>
      Here, we can input digits until our heart is content.
      However, if we input nothing, then the audio file will be repeated.
    </prompt>
    <goto value="#Dig_1"/>
  </do>

  <inputdigits label="Dig_1" value="MyIntro.wav" var="Dig_Var" repeat="5" maxsilence="5s" cache="yes" maxdigits="3">


  <on event="maxsilence">
    <prompt>
      you didnt enter any digits, home boy.
    </prompt>
  </on>

  <on event="maxdigits">
    <prompt>
      However, your digit input was $Dig_Var;
    </prompt>
  </on>

</inputdigits>

</callxml>


<3.0 inputdigits maxtime-termdigits-includetermdigit>
<?xml version="1.0" encoding="UTF-8"?>

<callxml version="3.0">
  <do label="B1">
    <prompt>
      Here, we can input digits until our heart is content.
      Or until max time elapses, whichever come first.
    </prompt>
    <goto value="#Dig_1"/>
  </do>

  <inputdigits label="Dig_1" value="MyIntro.wav" var="Dig_Var" maxtime="8s" termdigits="#" includetermdigit="true" maxsilence="12s"/>


  <on event="maxtime">
    <prompt>
      You must have reached max time.
    </prompt>
  </on>

  <on value="termdigit=#">
    <prompt>
      Hey, you must have hit the pound key.
      The digit values pressed are $Dig_Var;
    </prompt>
  </on>

</callxml>


<3.0 inputdigits next>
<?xml version="1.0" encoding="UTF-8"?>

<callxml version="3.0">

  <inputdigits label="Dig_1" value="MyIntro.wav" var="Dig_Var"
                    maxdigits="3" next="#B_3">


    <on event="maxdigits">
      <prompt>
        You must have pressed three digits.
      </prompt>
    </on>

  </inputdigits>


  <do label="B_2">
    <prompt>
      This block will be skipped!
    </prompt>
  </do>

  <do label="B_3">
    <prompt>
      We are now in the last target, designated by the
      input digits next attribute.   
    </prompt>
  </do>

</callxml>


<3.0 inputdigits-valueis>
<?xml version="1.0" encoding="UTF-8"?>

<callxml version="3.0">

  <do value="moe">

  <say>
  lets see about illustrating the value is attribute of input digits.
  you can press three digits here.
  </say>

<!-- this will not be executed, as 'moe' is not equal to 'larry' -->
  <inputdigits label="Dig_1" value="MyIntro.wav" var="Dig_Var"
                    maxdigits="3" next="#B_2" value-is="larry">


    <on event="maxdigits">
      <say>
        You must have pressed three digits.
      </say>
    </on>

  </inputdigits>

<!-- this will not be executed, as 'moe' is equal to 'moe' -->
  <inputdigits label="Dig_1" value="MyIntro.wav" var="Dig_Var"
                    maxdigits="3" next="#B_3" value-is-not="moe">


    <on event="maxdigits">
      <say>
        You must have pressed three digits.
      </say>
    </on>

  </inputdigits>


<!-- this will be executed, as 'moe' is not equal to 'curley' -->
  <inputdigits label="Dig_1" value="MyIntro.wav" var="Dig_Var"
                    maxdigits="3" next="#B_4" value-is-not="curley">


    <on event="maxdigits">
      <say>
        You must have pressed three digits.
      </say>
    </on>

  </inputdigits>
  </do>

  <do label="B_2">
    <say>
      This block will be skipped!
    </say>
  </do>

  <do label="B_3">
    <say>
      This block will be skipped!
    </say>
  </do>

  <do label="B_4">
    <say>
      We are now in the last target, designated by the
      input digits next attribute.   
    </say>
  </do>

</callxml>


<3.0 inputdigits-test>
<?xml version="1.0" encoding="UTF-8"?>

<callxml version="3.0">

  <do>

  <say>
  lets see about illustrating the value is attribute of input digits.
  you can press three digits here.
  </say>

<!-- this will not be executed, as 'moe' is not equal to 'larry' -->
  <inputdigits label="Dig_1" value="MyIntro.wav" var="Dig_Var"
                    maxdigits="3" next="#B_2" test="'moe' = 'larry'">


    <on event="maxdigits">
      <say>
        You must have pressed three digits.
      </say>
    </on>

  </inputdigits>

<!-- this will not be executed, as 'moe' is equal to 'moe' -->
  <inputdigits label="Dig_1" value="MyIntro.wav" var="Dig_Var"
                    maxdigits="3" next="#B_3" test="'moe' != 'moe'">


    <on event="maxdigits">
      <say>
        You must have pressed three digits.
      </say>
    </on>

  </inputdigits>


<!-- this will be executed, as 'shemp' is not equal to 'curley' -->
  <inputdigits label="Dig_1" value="MyIntro.wav" var="Dig_Var"
                    maxdigits="3" next="#B_4" test="'shemp' = 'curley'">


    <on event="maxdigits">
      <say>
        You must have pressed three digits.
      </say>
    </on>

  </inputdigits>
  </do>

  <do label="B_3">
    <say>
      This block will be skipped!
    </say>
  </do>

  <do label="B_4">
    <say>
      We are now in the last target, designated by the
      input digits next attribute.   
    </say>
  </do>

</callxml>




additional links
none


  ANNOTATIONS: EXISTING POSTS
ssa_VoPorta
9/4/2008 11:31 AM (EDT)
In the above example, where you use termdigits="#"  you show one of your 'events' as:

<on value="termdigit=#">
    <prompt>
      Hey, you must have hit the pound key.
      The digit values pressed are $Dig_Var;
    </prompt>
</on>

This doesn't work. You have to use the event:

<on event="termdigit:#">

We love the Voxeo platform, but it appears to me someone needs to take the time to go through the examples, and make sure they work and are correct. I assume your users often copy and paste code snippets directly from your examples.

CW
voxeo_chris
9/4/2008 11:40 AM (EDT)
Hey CW,

Thanks for notifying us of this and we will look into correcting it.  We are currently undergoing a massive reconstruction of the docs and rewriting all the code for the newer platforms.  You will be seeing older examples being replaced over the next few months.  We test all of our code and work hard to ensure that everything is compatible for many different scenarios. 

Regards,
Chris

login



© 2008 Voxeo Corporation  |  Voxeo IVR  |  VoiceXML & CCXML IVR Developer Site