CallXML 2.0 Development Guide Home  |  Frameset Home

This documentation is for CallXML 2, which has been superceded by CallXML 3. The CallXML 2 language is not being updated any longer. CallXML 3, however, has many new features and is actively being enhanced. If you're writing a new CallXML application, you should use CallXML 3. Click here for the CallXML 3.0 documentation.

<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. 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="string - URI" includetermdigit="(true|false)" label="(navigation identifier)" maxdigits="(numeric value)" maxsilence="(m|s|ms)" maxtime="(m|s|ms)" next="(navigation identifier)" repeat="(numeric value)" termdigits="(123456789*#|ABCD)" text="STRING" value="string - URI" var="(variable name)">


attributes

cache Data 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.
cleardigits Data Type: (true|false) Default: false
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.
format Data Type: string - URI Default: 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.
includetermdigit Data 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.
label Data 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
maxdigits Data 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.
maxsilence Data 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".
maxtime Data 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.
next Data Type: (navigation identifier) Default: none - attribute is optional
The 'next' attribute sets the URL the CallXML platform will go to when the container ends.
repeat Data 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.
termdigits Data 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".
text Data Type: STRING Default: none - attribute is optional
The 'text' attribute allows the developer to specify backup TTS to be output in the event that the .wav file cannot be found.
value Data Type: string - URI Default: none - attribute is required
The 'value' attribute defines the audio file to play to the caller when the parent element is first entered.
var Data 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.



possible events

onerror type="document" Document was unable to be fetched for all the reasons web servers are unavailable
onerror type="linenotactive" Trying to issue a telephony event such as <getdigits> or <playaudio> on a non-active line
onerror type="telephony" Unable to issue a telephony event such as <call> or <playaudio> or <ftp>
onhangup This event occurs when a session determines that one side of the call has hung up. A typical use for this handler is to execute any necessary clean-up code. See the onhangup element description for further details.
onmaxdigits This event occurs during user input if the length of the string of digits entered by the user exceeds the number indicated by a maxDigits attribute and a terminating digit has not yet been pressed. See the onmaxdigits element description for further details.
onmaxsilence This event occurs when the application has waited too long between digit entries or detects too much silence at the end of a recording session. See the onmaxsilence element description for further details.
onmaxtime This event occurs during user input if the user takes more time than is allowed by a maxTime attribute to input their entire response. See the onmaxtime element description for further details.
ontermdigit Used for catching and handling term digit events as they occur in the call flow. See the ontermdigit element description for further details.



code samples

<Inputdigits label - value - var - maxdigits>
<?xml version="1.0" encoding="UTF-8"?>

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

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


  <onmaxdigits>
    <text>
      You must have pressed three digits, which equates to $Dig_Var; .
    </text>
  </onmaxdigits>

</callxml>



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

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

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


  <onmaxsilence/>

  <onmaxdigits>
    <text>
      However, your digit input was $Dig_Var;
    </text>
  </onmaxdigits>


</inputdigits>



</callxml>


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

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

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


  <onmaxtime>
    <text>
      You must have reached max time.
    </text>
  </onmaxtime>

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

</callxml>


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

<callxml version="2.0">

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


    <onmaxdigits>
      <text>
        You must have pressed three digits.
      </text>
    </onmaxdigits>

  </inputdigits>


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

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

</callxml>



additional links

none


  ANNOTATIONS: EXISTING POSTS
0 posts - click the button below to add a note to this page

login



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