CallXML 3.0 Development GuideHome  |  Frameset Home


<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)" id="(element id)" label="(navigation identifier)" maxsilence="(m|s|ms)" maxtime="(m|s|ms)" next="(navigation identifier)" playformat="URI" playvalue="URI" recordformat="URI" repeat="(numeric value)" say="STRING" termdigits="(123456789*#|ABCD)" test="CDATA" value="URI" value-is="STRING" value-is-not="STRING">


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.
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.
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.
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
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"...>
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.



code samples
<3.0 inputaudio label-playvalue-value-beep>
<?xml version="1.0" encoding="UTF-8"?>

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

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


</callxml>


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

<callxml version="3.0">

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

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


    <onmaxsilence/>

  <on event="termdigit=#">
    <prompt>
      You must be finished recording your audio.
    </prompt>
  </on>

  </inputaudio>



</callxml>

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

<callxml version="3.0">
  <do label="B1">
    <prompt>
      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.
    </prompt>
  </do>

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


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

    <on event="maxsilence">
      <prompt>
        You must have been silent for over 2 seconds.
      </prompt>
    </on>

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

  </inputaudio>

</callxml>


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

<callxml version="3.0">

  <do value="depp">
    <say>
      Here you can record some audio, followed by the pound key.
      However, if you stay silent, the
      wav file will repeat itself twice.
    </say>

<!-- this will *not* be executed, as depp is not equal to greco -->
  <inputaudio playvalue="MyIntro.wav"
      value="mailto:you@somewhere.com"
      termdigits="#"
      value-is="greco"
      text="hello there. give me some audio input please.">


  <on value="termdigit=#">
    <log>this will never happen</log>
  </on>

  </inputaudio>


<!-- this will *not* be executed, as depp is equal to depp -->
  <inputaudio playvalue="MyIntro.wav"
      recordvalue="mailto:you@somewhere.com"
      termdigits="#"
      value-is-not="depp">


  <on value="termdigit=#">
    <log>this will never happen</log>
  </on>

  </inputaudio>

<!-- this will be executed, as depp is not equal to depp -->
  <inputaudio playvalue="AnotherIntro.wav"
      recordvalue="mailto:you@somewhere.com"
      termdigits="#"
      value-is="depp"
    text="hello there. give me some audio input please.">


    <on event="maxsilence"/>

  <on value="termdigit=#">
    <say>
      You must be finished recording your audio.
    </say>
  </on>

  </inputaudio>

  </do>

</callxml>


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

<callxml version="3.0">

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

<!-- this will *not* be executed, as 1 is not equal to 2 -->
  <inputaudio playvalue="MyIntro.wav"
      value="mailto:you@somewhere.com"
      termdigits="#"
      test="1 = 2"
      text="hello there. give me some audio input please.">


  <on value="termdigit=#">
    <log>this will never happen</log>
  </on>

  </inputaudio>


<!-- this will *not* be executed, as foo is equal to foo -->
  <inputaudio playvalue="MyIntro.wav"
      recordvalue="mailto:you@somewhere.com"
      termdigits="#"
      test="'foo' != 'foo'">


  <on value="termdigit=#">
    <log>this will never happen</log>
  </on>

  </inputaudio>

<!-- this WILL be executed, as Axl Rose is not equal to Sobriety -->
  <inputaudio playvalue="AnotherIntro.wav"
      recordvalue="mailto:you@somewhere.com"
      termdigits="#"
      test="'Axl Rose' != 'Sobriety'"
    text="hello there. give me some audio input please.">


    <on event="maxsilence"/>

  <on event="termdigit:#">
    <say>
      You must be finished recording your audio.
    </say>
  </on>

  </inputaudio>

  </do>

</callxml>




additional links
none


  ANNOTATIONS: EXISTING POSTS
eugene_gunichev
9/12/2007 9:35 AM (EDT)
There are typos related to the event handlers:

1) <on value="termdigit=#"> should be <on event="termdigit:#">
2) in the third example all handlers are outside of <inputaudio> element.
MattHenry
9/12/2007 3:53 PM (EDT)

Hello Eugene,

Thanks for catching those. The 'value' attribute was a leftover of our initial implementation of CXML 3.0 handler syntax; I thought I had scrubbed instances of this from the docs, but I reckon I missed this one.

Both of these items that you pointed out have been fixed in the internal docset build, which should be live in the next few days.

Regards,

~Matt
emspms
4/25/2008 1:11 PM (EDT)
Well after having posted doc updates on other tags, and not seeing the docs updated, also seeing that eugene's updates are acknowleged and not corrected in the current documentation, I can only hope people read all the annotations when things fail for them.

Apparently taking some callxml 2.0 examples (which work in 2.0 but not 3.0), AND examples from above, recordvalue does not work. (I was trying ftp)
I opened a support ticket, and this is the response.

VoxeoDustin
Extreme Support replies to my support ticket:
This appears to be a bug with the attributes of CallXML 3.0. I did a little testing and if you replace 'recordvalue' with 'value', the file should be saved properly. I have opened internal Engineering ticket #635684 regarding the bug.

Therefore although documented 'value' is NOT the audio played to the customer (as 'playvalue' is)
and looking at the documentation for recordaudio, I assume that 'recordformat' might also be replaced with just 'format'
to make it match recordaudio in 3.0


I also notice that like the callxml 2.0 documentation for this tag, it says to refer to the list of handled events, however, unlike the callxml 2.0 documentation, they are not listed here.
MattHenry
4/25/2008 4:11 PM (EDT)

All,

Apologies for the confusion regarding this topic; I'll try to explain:

Older implementations of CallXML did in fact use the 'recordvalue' attribute, but this was recently changed to the 'value' attribute, and we neglected to update our documentation appropriately: Apologies for this; I have addressed this in an internal doc build, and this update will be posted live no later than 4/28/08.

To be clear, there is *not* a platform bug present here, this is simply a case of the nomenclature changing from one software version to the next: developers from this point forward should consider the following attribute description as being valid:

ELEMENT: inputaudio
ATTRIBUTE: value

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... recordvalue="http://MyServer.com/MycatherScript.cfm"...>


Sorry for any confusion,

~Matthew Henry


login



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