CallXML 3.0 Development GuideHome  |  Frameset Home


<hangup>  element

This element instructs the CallXML browser to "hang-up" or disconnect the call associated with the current session.


usage
<hangup id="(element id)" test="CDATA" value-is="STRING" value-is-not="STRING">


attributes
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.
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.
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 hangup>
<?xml version="1.0" encoding="UTF-8"?>

<callxml version="3.0">
  <do label="B1">
    <prompt>
      Hey, we have a rude phone application on our hands.
      Any minute now, it will hang up on you.
    </prompt>

    <wait value="3s"/>

    <hangup/>
  </do>
</callxml>


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

<callxml version="3.0">
  <do label="B1" value="moo">
    <prompt>
      Hey, we have a rude phone application on our hands.
      Any minute now, it will hang up on you.
    </prompt>

    <wait value="3s"/>


<!-- neither of these will execute -->
    <hangup value-is="goo"/>
    <hangup value-is-not="moo"/>

    <prompt>
    Just kidding.
    </prompt>
  </do>

  <do label="B2" value="moo">
    <prompt>
      Okay, I promise that any minute now,
      it will hang up on you for real.
    </prompt>

    <wait value="3s"/>

<!-- either of these will execute -->
    <hangup value-is-not="goo"/>
    <hangup value-is="moo"/>


  </do>

</callxml> 


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

<callxml version="3.0">
  <do label="B1">
    <prompt>
      Hey, we have yet another rude phone application on our hands.
      Any minute now, it will hang up on you.
    </prompt>

    <wait value="3s"/>


<!-- neither of these will execute -->
    <hangup test="1 = 2"/>
    <hangup test="REM' = 'relevant in any way'"/>

    <prompt>
    Just kidding.
    </prompt>
  </do>

  <do label="B2">
    <prompt>
      Okay, I promise that any minute now,
      it will hang up on you for real.
    </prompt>

    <wait value="3s"/>

<!-- either of these will execute -->
    <hangup test="1 = 1"/>
    <hangup test="'Michael Bolton' != 'Talented'"/>


  </do>

</callxml> 




additional links
none


  ANNOTATIONS: EXISTING POSTS
jpw
1/24/2008 8:10 PM (EST)
does <hangup/> just hangup and quit, like <exit/>, and if so, what is the difference?

Or, does <hangup/> throw a hangup event? eg, if you put a <hangup/> inside a <do> block that contains an
<on event="hangup"> handler, will that "hangup" handler get invoked?
VoxeoDustin
1/24/2008 9:18 PM (EST)
Hey JP,

<hangup/> will drop the call leg and throw a hangup event that can be caught. <exit/> will end the session, but it will not throw a user catcheable event, including a hangup. Typically, you'll want a hangup event to catch hangups, and within that event an <exit/> to end the session once we're done with any cleanup.

Thanks,
Dustin

login



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