CCXML 1.0-W3C Development GuideHome  |  Frameset Home


<redirect>  element

The <redirect> tag will redirect an incoming phone call to the specified destination telephony address URL.  This URL can be a VOIP endpoint, another phone number, etc. If a <redirect> is executed before the call is accepted the Prophecy platform will do a SIP redirect (302). Conversely, if executed after a call has been accepted a SIP refer will be executed.



usage
<redirect dest="(ECMAScript Expression)" hints="(ECMAScript Expression)" reason="(ECMAScript Expression)">


attributes
destData Type: (ECMAScript Expression)Default: none - attribute is required
This attribute indicates the telephone URL which evaluates to the target for the outbound call. Not specifying this element will certainly cause a fatal, application-stopping error.
hintsData Type: (ECMAScript Expression)Default: Optional
The hints attribute can be used to specify information used by the platform to configure the event processor. The value of this attribute should equate to an object that contains an array property of "headers"; for instance:


<script>
  var Hints = new Object();
  Hints.headers = new Object();
  Hints.headers['x-mySipHeader'] = 'hello world';
</script>


Note that 'hints.headers' stores what headers to add to the sip request, and that only headers starting with an 'x-' prefix are sent.
reasonData Type: (ECMAScript Expression)Default: none - attribute is optional
The reason attribute returns a user-defined ECMAScript string indicating the reason for the call being redirected. The value returned will be a standard HTTP status code, (i.e., "500" etc).



parents
none


children
none


code samples
<1.0 redirect>
<?xml version="1.0" encoding="UTF-8"?>
<ccxml version="1.0" xmlns="http://www.w3.org/2002/09/ccxml">

  <var name="conn_id" expr="''" />
  <var name="statevar" expr="'state0'"/>
 
  <eventprocessor statevariable="statevar">
 
    <transition state="state0" event="connection.alerting">
      <assign name="statevar" expr="'state1'"/>
      <assign name="conn_id" expr="event$.connectionid" />
      <log expr="'*** Accepting the connection ***'"/>
      <accept connectionid="conn_id"/>
    </transition>
   
    <transition state="state1" event="connection.connected">
      <assign name="statevar" expr="'state2'"/>
      <log expr="'*** Redirecting, please stand by ***'"/>
      <!-- Since the call has been accepted already a SIP REFER will be executed here -->
      <redirect connectionid="conn_id" dest="'tel:+14071112222'"/>
    </transition>
   
    <transition state="state2" event="connection.redirected">
        <log expr="'Redirect successful!'"/>
        <exit/>
    </transition>
   
    <transition event="connection.redirect.failed">
      <log expr="'The redirect failed...'"/>
      <exit/>
    </transition>
   
    <transition event="error.*">
      <log expr="'An error occurred: ' + event$.reason"/>
      <exit/>
    </transition>
     
  </eventprocessor>
</ccxml>



additional links
W3C SpecificationTelephone URL Formatting


  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