< transfer >

The <transfer> attribute transfers the caller to another phone number. There are two types of transfer:

  • bridge transfer – the caller resumes the interpreter session after a call with the third party.
  • blind transfer – as soon as the call with the third party connects, the platform throws a telephone.disconnect.transfer and terminates the interpreter session.
<transfer
name="String"
expr="ECMAScript_Expression"
cond="ECMAScript_Expression"
dest="URI"
destexpr="ECMAScript_Expression"
bridge="true" | "false"
connecttimeout="time_interval"
maxtime="time_interval"
transferaudio="URI"
analysis="true" | "false"
uuidata="">
child elements
</transfer>
NameThe name attribute is the name of the field item variable. It stores the result of the <transfer> and is required. The returned values are:
* busy – the endpoint refused the call.
* noanswer – there was no answer within the time specified by the connecttimeout attribute.
* network_busy – some intermediate network refused the call.
* near_end_disconnect – the call was completed and terminated by the caller.
* far_end_disconnect – the call was completed and terminated by the caller.
* network_disconnect – the call was completed and terminated by the network.
* maxtime_disconnect – the call duration exceeded the value of maxtime attribute and was terminated by the platform.
* unknown – the outcome of transfer is unknown.
* not_allowed– not allowed to use the <transfer> element for this document.
* far_end_machine – detects an answering machine picking up the call when analysis attribute is set to true.
* far_end_fax – detects fax machine picking up the call when analysis attribute is set to true.
* invalid_phone_no – phone number in dest or destexpr attribute is not a valid phone number format.
* restricted_phone_no – phone number is restricted.
exprThe expr attribute is an expression that assigns the initial value of the field item variable. The <transfer> element will be executed only if the value is undefined. This attribute is optional and defaults to undefined.
condThe cond attribute is a Boolean expression that must evaluate to true for this <transfer> element to execute. This attribute is optional and defaults to true.
destThe dest attribute is a URI of the destination phone. The format is: tel:\ \ 73643543. Some URI prefix have been added to extend the functionalities of the VoiceXML interpreter. This attribute is required – specifically dest or destexpr is required.
destexprThe destexpr attribute is an expression that yields the destination. This attribute is required – specifically dest or destexpr is required.
bridgeThe bridge attribute determines what to do after call is connected. Please refer to the description of this element for the 2 types of transfer. This attribute is optional and defaults to true.
* true – a bridge transfer.
* false –a blind transfer.
connecttimeoutThe connecttimeout attribute is the time to wait while trying to connect the call before returning the noanswer condition. The minimum value allowed is 5s. This attribute is optional and defaults to 30s. (30 seconds)
maxtimeThe maxtime attribute is the maximum time that the call is allowed to last. Minimum value is 30 seconds; maximum is one week, and 0 for no limit. This attribute only applies when bridge=true. This attribute is optional and defaults to 0.
transferaudioThe transferaudio attribute is the URI of the audio file to be played while connecting the call. This attribute is optional (not supported).

The <transfer> shadow variable (name$) has the following property after the transfer completes: name$.duration – the duration of a successful call in seconds. If the duration is 0, the call was terminated before it was answered.

The following events can be thrown during the execution of the <transfer> element:

  • connection.disconnect.hangup – the caller hangs up.
  • connection.disconnect.transfer – the call was “blind transferred” to another line and will not return.
  • error.connection.noauthroization – the caller is not allowed to call the destination.
  • error.connection.baddestination – the destination URI is malformed.
  • error.connection.noroute – the platform is not able to place a call to the destination.
  • error.connection.noresource – the platform cannot allocate a resource to place the call.
None.
<audio>, <catch>, <enumerate>, <error>, <filled>, <help>, <nomatch>, <noinput>, <grammar>, <prompt>, <property>, <value>
“execute:” or "exec:" or “application:” (with an application name and ())
The <transfer> tag can be used to “execute” an Asterisk application.
Set the attribute dest with a URI like "execute:applicationname(parameters)".

Use “set” to set a variable to the Asterisk channel context:
<transfer name="setvar" bridge="true" dest="execute:set(VXML_NUMBER=10)">

Use “get” to get a variable value from the Asterisk channel context (value is in the value shadow variable):
<transfer name="getvar" bridge="true" dest="execute:get(URL)" />
<value expr="getvar$.value" />.

Use “function:” to set an Asterisk function:
<transfer name="maxduration" bridge="true" dest="execute:function(TIMEOUT(absolute)=10)">

Use '+=' to append values:
<transfer name="userfield" bridge="true" dest="execute:function(CDR(userfield))+=12" />

Use “function” to get a Asterik function's value:
<transfer name="peerip" bridge="true" dest="execute:function(SIPPEER(user2:ip))">
<value expr="peerip$.value" />.

Use “conference :”
The <transfer> tag can be used to “push” the call into a conference.  Set the attribute dest with a URI like "conference:x", where the value x is the id of the conference (you can add the conference parameters after a '/' too, or using the conferenceformat).  The conference resources must be configured if more than two lines are set in call conferencing.

Use “originate:” or “ori:”
The <transfer> tag can be use to generate an outgoing call and links it to an application or context. If the maxtime is set to 0, the transfer doesn’t wait the establishment. The variable content and events are set link a standard bridge transfer.

Example:

<transfer name="test" bridge="true" dest="originate:user1=Voximal(account2)" connecttimeout="20s" maxtime="0s"/>

The transfer now supports the bridge, with SIP re-inivite or a new session, and blind mode with SIP refer. The blind mode can be configured to use a specific asterisk application with the configuration parameter blindapplication=application_name (the parameter is the dest value). If you set the blindapplication with the empty value, the vxml Asterisk application will perform a Dial at the end of the blind session. You should specify the channel used to generate the outgoing call. Use the application Dial syntax, for example, dest=”tel:SIP/600@localhost”. You can use the parameter dialformat in the configuration file vxml.cfg to specify a string format, for example, dialformat=”SIP/%s@dialout”. You can use videodialformat for the video calls too. This parameters can be global in the general section or specific to an account.

<?xml version="1.0"?>
<vxml version="2.0" xmlns="http://www.w3.org/2001/vxml">
<form>
 <var name="calldur" expr="0"/>
 <block>
  <prompt>
   Welcome
  </prompt>
 </block>
 <transfer name="newcall" dest="0146120000"
   connecttimeout="10s" bridge="true">
   <filled>
    Your call lasted <value expr="newcall$.duration"/> seconds.
    <if cond="newcall == 'busy'">
     <prompt>
      All our customer care agents are currently busy.
      Please call back later.
     </prompt>
    </if>
   </filled>
  </transfer>
 </form>
</vxml>