CallXML 2.0 Development GuideHome  |  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.
<inputaudio>  element

The <inputAudio> element combines the attributes and functionality of a <block> element, <playAudio> element, and a <recordAudio> element. The intent of this element is to foster easy creation of CallXML code which will prompt the user to record audio, such as when leaving a voicemail message or changing a voicemail greeting. 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
<inputaudio beep="(true|false)" cache="(yes|no)" cleardigits="(true|false)" label="(navigation identifier)" maxsilence="(m|s|ms)" maxtime="(m|s|ms)" next="(navigation identifier)" playformat="URI" playvalue="URI" recordformat="URI" repeat="(numeric value)" termdigits="(123456789*#|ABCD)" text="STRING" value="URI">


attributes
beepData Type: (true|false)Default: true
The beep attribute, when set to true, allows the developer to insert a ‘beep tone’ to indicate to the caller that the application has begun recording. If set to 'false',  the caller will not hear the beep indicating that the recording has started.
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.
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
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.
playformatData Type: URIDefault: none - attribute is optional
The playformat attribute essentially mimes the functionality of the format attribute for the <play..> element. The value for this should reflect the MIME type of the audio file that will be played to the caller.
playvalueData Type: URIDefault: none - attribute is required
The playvalue attribute functions in the same way as the <playaudio> element, in that the value defined should be a URI reference which indicates the sound file to play to the caller.

The indicated value can either be a complete URI:
http://Myserver.com/MyDir/MySoundFile.wav

or a relative URI:
MySoundFile.wav
recordformatData Type: URIDefault: none - attribute is optional
The recordformat attribute works essentially the same as the format attribute of the <recordaudio> element. Go figure. The value for this attribute should indicate the MIME type of the recorded audio. If unspecified, then this will default to the value of 'audio/wav'.
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.
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".
textData Type: STRINGDefault: 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.
valueData Type: URIDefault: none - attribute is required
This attribute works the same as the value attribute for the <recordaudio> element. The value should specify a value in any of the following formats:
  • variable name in which to store the recorded audio file:
    < inputaudio... value="MyVar"...>

  • A URI indicating a FTP upload: < inputaudio... value="ftp://MyUsername:MyLogin@MyServer.com"...>
  • A URI indicating a mailto operation: < inputaudio... value="mailto:Jesus@Heaven.org"...> or http PUT operation: < inputaudio... value="http://MyServer.com/MycatherScript.cfm"...>



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>
onhangupThis 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.
onmaxdigitsThis 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.
onmaxtimeThis 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.
onmaxsilenceThis 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.
ontermdigitUsed for catching and handling term digit events as they occur in the call flow. See the ontermdigit element description for further details.



code samples
<Inputaudio label - playvalue -recordvalue - beep>
<?xml version="1.0" encoding="UTF-8"?>

<callxml version="2.0">
  <block label="B1">
    <text>
      Ready to input some audio?
      Lets go then, babycakes.
    </text>
    <goto value="#Aud_1"/>
  </block>

  <inputaudio label="Aud_1" playvalue="MyIntro.wav"
      recordvalue="mailto:Thor@valhalla.com" beep="true"/>


</callxml>


<Inputaudio repeat - cache - termdigits>
<?xml version="1.0" encoding="UTF-8"?>

<callxml version="2.0">


  <block>
    <text>
      Here you can record some audio, followed by the pound key.
      However, if you stay silent, the
      wav file will repeat itself twice.
    </text>
  </block>

  <inputaudio playvalue="MyIntro.wav"
      recordvalue="mailto:billgates@hell.org"
      cache="yes"
      termdigits="#"
      repeat="2">


    <onmaxsilence/>

  <ontermdigit value="#">
    <text>
      You must be finished recording your audio.
    </text>
  </ontermdigit>

  </inputaudio>



</callxml>

<Inputaudio maxtime - maxsilence - termdigits>
<?xml version="1.0" encoding="UTF-8"?>

<callxml version="2.0">
  <block label="B1">
    <text>
      Here we can record 10 seconds of audio.
      However, if we are silent for more than 2 seconds,
      or press the pound key,
      then the recording session will end.
    </text>
  </block>

  <inputaudio label="Aud_1" playvalue="MyIntro.wav"
      recordvalue="mailto:Loki@valhalla.com" maxsilence="2s"
      maxtime="10s" termdigit="#"/>


    <onmaxtime>
      <text>
        You must have reached max time for the recording session.
      </text>
    </onmaxtime>

    <onmaxsilence>
      <text>
        You must have been silent for over 2 seconds.
      </text>
    </onmaxsilence>

    <ontermdigit value="#">
      <text>
        You must have pressed the termdigit
        after you were done recording.
      </text>
    </ontermdigit>

</callxml>




additional links
none


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

login



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