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

The <block> element is used to logically group action and event elements together, as well as providing the ability to loop the actions in the block a specified number of times. Note that <block> elements may be nested within each other to foster more structured CallXML interface code.


usage
<block cleardigits="(true|false)" label="(navigation identifier)" next="(navigation identifier)" repeat="(numeric value)">


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



possible events
onerror type="badnumber"The destination number is malformed, or returns a SIT tone.
onerror type="document"Document was unable to be fetched for all the reasons web servers are unavailable
onerror type="execution"Indicates that a child session specified in the <run> tag points to an invalid URI.

onerror type="invalidconference"Bad target conference
onerror type="lineactive"Trying to issue a telephony event such as <answer> on an already active line
onerror type="linenotactive"Trying to issue a telephony event such as <getdigits> or <playaudio> on a non-active line
onerror type="serverbusy"No sessions available on the server for <run> or <answer> etc
onerror type="telephony"Unable to issue a telephony event such as <call> or <playaudio> or <ftp>
onerror type="unknown"General error not fitting into any other category
onerrortype="event"When certain errors occur an <onError> event is generated. This gives the CallXML developer a way to handle error conditions that may occur while CallXML actions are executing.
onexternaleventThis event occurs when another session sends an external event to the current session. See the onexternalevent element description for further details.
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.
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.
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.
ontermdigitUsed for catching and handling term digit events as they occur in the call flow. See the ontermdigit element description for further details.
onanswerThis event occurs when a session determines that a call has been answered. This element is used as a handler to transition an action or event in a CallXML script after executing a <call> action. See the onanswer element description for further details.
oncallfailureThis event occurs when the session determines that the attempted call cannot be completed because the dialed number is busy, a circuit is unavailable, a SIT tone was detected or other detectable call failure mode. The call is not automatically disconnected; rather, this element allows the developer to catch the event and attempt another action. See the oncallfailure element description for further details.



code samples
<Block label - repeat>
<?xml version="1.0" encoding="UTF-8"?>

<callxml version="2.0">
  <block label="B1" repeat="1">
    <text>
      here is the first block.
    </text>
    <goto value="#B2"/>
  </block>

  <block label="B2" repeat="2">
    <text termdigits="*">
      here is the second block.
      If you wait before pressing the star key, you will hear
      this text prompt play twice.
    </text>
    <ontermdigit value="*">
      <text>
        you pressed the star key
      </text>
    </ontermdigit>
  </block>
</callxml>


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

<callxml version="2.0">

  <block label="B_1" next="#B_3">
    <text>
      once this block of TTS is executed, we will skip to block label
      B 3 via the next attribute
    </text>
  </block>


  <block label="B_2" next="Another_Document.xml">
    <text>
      And finally, we enter block label B 2, which is executed
      last
    </text>
  </block>


  <block label="B_3" next="#B_2">
    <text>
      And here we are in block label B 3
    </text>
  </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