The <Transfer/> Element
This element permits to transfer the call to a Basix user, group, conference room, voicemail box, PSTN number etc.
To transfer to a user voicemail box, you can pass "uservoicemail,UserName" as transfer target.
To transfer to a group voicemail box, you can pass "groupvoicemail,GroupName" as transfer target.
Element Attributes
| Attribute Name |
Description |
Allowed Values |
Default Value |
| callingNumber |
Optional: a calling number to be used in case the transfer is done to PSTN (it must be a calling number belonging to your Basix PBX). If not provided, your Basix domain calling number will be used. |
|
none |
| failureAction |
Optional: URL to be called if transfer fails. It can be a list of URLs separated by commas to permit fallback. See XML Fetch Fallback. |
This attribute is optional. |
None |
| answerTimeout |
Optional: overrides the default answer timeout of the transfer target (user or group). Only valid if attribute failureAction is provided |
5 to 180 seconds |
none |
| suppressPreAnswerAudio |
Optional: for transfers to PSTN, suppresses the pre-answer audio (ringing etc) with MusicOnHold |
true or false |
false |
| relayReceivedCallingNumber |
Optional: in case of transfer to PSTN, if set to true, forces relay of ANI received from caller (cannot be used with attribute callingNumber) |
true or false |
false |
- for transfers to PSTN, answerTimeout will only work if suppressPreAnswerAudio is set to 'true'.
- in case of transfer to users or groups, if failureAction is set and the target has forward enabled, forward will not be executed: the transfer will fail and failureAction will be contacted.
- if Transfer fails, variable TransferFailureReason will be set and can be inspected using element Switch.
Examples
Example 1: Transfer to PSTN number
1
2
3
|
<IVR>
<Transfer>0312341234</Transfer>
</IVR>
|
Example 2: Transfer to PSTN number with callingNumber
1
2
3
|
<IVR>
<Transfer callingNumber="05068681111">0312341234</Transfer>
</IVR>
|
Example 3: Transfer to extension number with failureAction (2 URLs) and answerTimeout
1
2
3
|
<IVR>
<Transfer failureAction="http://somewhere1/failed,http://somewhere2/failed" answerTimeout="20">1000</Transfer>
</IVR>
|
Example 4: Transfer to user jones
1
2
3
|
<IVR>
<Transfer>jones</Transfer>
</IVR>
|
Example 5: Transfer to group sales
1
2
3
|
<IVR>
<Transfer>sales</Transfer>
</IVR>
|
Example 6: Transfer to voicemail box of user jones
1
2
3
|
<IVR>
<Transfer>uservoicemail,jones</Transfer>
</IVR>
|
Example 7: Transfer to voicemail box of group sales
1
2
3
|
<IVR>
<Transfer>groupvoicemail,sales</Transfer>
</IVR>
|
Example 8: Transfer to PSTN suppressing pre-answer PSTN audio
1
2
3
|
<IVR>
<Transfer suppressPreAnswerAudio="true" answerTimeout="10" failureAction="http://somewhere/failed">0312341234</Transfer>
</IVR>
|
Example 9: Transfer with failureAction set to a section Section in the same XML document
1
2
3
4
5
6
7
8
|
<IVR>
<Section name="main">
<Transfer failureAction="transferFailure">sales</Transfer>
</Section>
<Section name="transferFailure">
<Speak voice="en-US-Standard-C">Sorry. Transfer to sales failed.</Speak>
</Section>
</IVR>
|
Example 10: Transfer with failureAction set to a XML file
1
2
3
4
5
|
<IVR>
<Section name="main">
<Transfer failureAction="file://failure_handler.xml">sales</Transfer>
</Section>
</IVR>
|
Example 11: Transfer with failureAction set to XML server URLs and fallback to a file
1
2
3
4
5
|
<IVR>
<Section name="main">
<Transfer failureAction="https://xxx.com/failure,https://yyy.com/failure,https://zzz.com/failure,file://failure.xml">sales</Transfer>
</Section>
</IVR>
|
Example 12: interpolation with data from JSON
1
2
3
4
5
6
7
8
9
10
11
12
|
<IVR>
<GetJSON var="data" url="https://somewhere.com/calling_number={{CallingNumber}}"/>
<Section name="main">
<Transfer failureAction="{{data.failureAction}}">{{data.transferTarget}}</Transfer>
</Section>
<Section name="failureHandler1">
<Speak voice="en-US-Standard-C">Sorry. Please try again later</Speak>
</Section>
<Section name="failureHandler2">
<Transfer>last_resort</Transfer>
</Section>
</IVR>
|
Example 13: playing a message on failure
1
2
3
4
|
<IVR>
<Transfer>0311112222</Transfer>
<Speak voice="en-US-Standard-C">Sorry, the destination didn't answer your call. Bye</Speak>
</IVR>
|