CCXML 1.0-W3C Development Guide Home  |  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.

In a conference situation, when a call is joined, it will be unjoined from the conference before the redirect is performed. When unjoined, the conference.unjoined event is thrown.


usage

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


attributes

dest Data 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. The voxeo platform follows the RFC's for both 'telephone' and 'sip' values, (RFC2806and RFC3261, respectively):

<createcall dest="'tel:+18002223333'"...> (absolute syntax)
<createcall dest="'tel:18002223333'"...> (exact syntax)
<createcall dest="'sip:xxx.xxx.xxx.xxx'" ...> (sip address)


Note: that developers who use the non-US datacenters are required to specify an E164-formatted dial string:

tel:+[country code][number]
hints Data 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" as shown in the following example:

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

Note: The hints.headers stores what headers to add to the sip request, and that only headers starting with an 'x-' prefix are sent.
reason Data 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 Specification Telephone URL Formatting


  ANNOTATIONS: EXISTING POSTS
moshe
10/9/2009 3:16 PM (EDT)
The example for the attribute "dest" uses "createcall" as the element name. It should read "redirect" as the element name.

The attribute "connectionid" is missing from the list entirely. Connectionid is not required if the event makes it clear which connectionid is used. (For example, a "connection.connected" event contains connectionid, and any redirect executed in that event's transition would use that connectionid by default.
VoxeoDante
10/9/2009 3:24 PM (EDT)
Hello Moshe,

Thanks for pointing that out. I will make sure to update the next set of the docs with the corrections.

Cheers,
Dante Vitulano
Customer Support Engineer II
Voxeo Corporation

login



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