CCXML 1.0-W3C Development GuideHome  |  Frameset Home


<else>  element

The else element is used as the final logic constructor in an array of conditional statements. The content nested within the else element will get executed when all other if and elseif  cond attributes evaluate to ‘false’.


usage
<else />


attributes
none


parents
none


children
none


code samples
<1.0 else> sample
<ccxml version="1.0">

  <var name="initState" expr="'state_1'"/>
  <var name="MyCallID"/>

  <eventprocessor statevariable="initState">

    <transition event="connection.alerting" state="state_1">
      <assign name="MyCallID" expr="event$.connectionid"/>
        <log expr="'***** MYCALLID =' + MyCallID + '****' "/>
      <send name="'MyEvent'" target="session.id"/> 
    </transition>

    <transition event="MyEvent">
        <accept connectionid="MyCallID"/>     
    </transition>

    <transition event="connection.connected">
      <log expr="'***** CALL WAS ANSWERED *****'"/>
    <if cond="MyCallID == '4075551234'">
        <log expr="'*** \'IF\' CONDITION IS TRUE ***'"/>
        <dialogstart src="'null://?text=Your caller ID must be 4 0 7 5 5 5 1 2 3 4'" type="'application/x-texttospeech'"/>

      <elseif cond="MyCallID == '4075554321'"/>
        <log expr="'*** \'ELSEIF\' CONDITION IS TRUE ***'"/>
      <dialogstart src="'null://?text=Your caller ID must be 4 0 7 5 5 5 4 3 2 1'" type="'application/x-texttospeech'"/> 

      <else/>
        <log expr="'*** \'ELSE\' STATEMENT REACHED ***'"/>
              <dialogstart src="'null://?text=Your caller ID is neither 4 0 7 5 5 5 1 2 3 4,
                            or 4 0 7 5 5 5 4 3 2 1'" type="'application/x-texttospeech'"/>
      </if>
    </transition>

    <transition event="dialog.exit">
      <log expr="'***** CALL EXITING *****'"/>
      <exit/>
    </transition>
  </eventprocessor>

</ccxml>



additional links
W3C Specification


  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