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.
<playaudio>  element

The <playAudio> element is used to output a .wav or a .vox file to the caller. Unless the caller takes some action, as (when used in conjunction with <getdigits>, for example),  the audio will repeat as many times as indicated for the parent <block> element.


usage
<playaudio cache="(yes|no)" cleardigits="(true|false)" format="URI" termdigits="(123456789*#|ABCD)" text="STRING" value="URI">


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.
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
The 'value' attribute defines the audio file to play to the caller when the parent element is first entered.



possible events
onerror type="document"Document was unable to be fetched for all the reasons web servers are unavailable
onerror type="telephony"Unable to issue a telephony event such as <call> or <playaudio> or <ftp>
ontermdigitUsed for catching and handling term digit events as they occur in the call flow. See the ontermdigit element description for further details.
onerror type="linenotactive"Trying to issue a telephony event such as <getdigits> or <playaudio> on a non-active line
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.



code samples
<Playaudio value - termdigits - cache - format>
<?xml version="1.0" encoding="UTF-8"?>

<callxml version="2.0">
  <block repeat="5">
    <playaudio value="ifeelgood.wav" termdigits="#" cache="no"
      format="audio/wav"/>


    <ontermdigit value="#">
      <text>
        so, you dont like james Brown then?
      </text>
    </ontermdigit>

  </block>
</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