Redirect element transfers control of a call to a different URL, which then returns a fresh <Response> to drive the rest of the flow. The redirect URL is the element’s text content. Any elements placed after <Redirect> are never processed - Redirect must be the last element you intend to run.
Attributes
method (string)
HTTP method used to request the redirect URL.
Allowed values: GET, POST
Defaults to POST.
Nesting rules
Redirect takes no child elements. Its text content is a single fully qualified HTTPS URL. Redirect cannot be nested inside another verb - it is a top-level child of <Response>.
Parameters sent in the redirect request
|From |
| string |
| The phone number of the party that initiated the call, along with the country code. If the call is inbound, then this is the caller’s caller ID. If the call is outbound - initiated via a request to the API - then this is the phone number you specify as the caller ID. |
| To |
| string |
| The phone number of the called party, with the country code. If the call is inbound, then this is your incoming phone number. If the call is outbound, then this is the phone number you provided to call. |
| Event |
| string |
| The string Redirect. |
| CallUUID |
| string |
| A unique identifier for the call. |
| CallerName |
| string |
| For a SIP call, this is the name of the caller. For a PSTN call, this is the caller ID. |
| Direction |
| string |
| The direction of the call. In most cases this is inbound and the call is in a ringing state. If you are using the Call API, the direction is outbound and the call is in an answered state. |
| CallStatus |
| string |
| The status of the call. The value may be ringing, in-progress, or completed. If the call is hung up, CallStatus is set to completed for inbound calls and to completed, busy, failed, timeout, or no-answer for outbound calls. |
Examples
Redirect to a new flow
When theSpeak element finishes, Vobiz requests the redirect URL and runs whatever XML it returns.
Loop back to a menu
UseRedirect to re-present an IVR menu after invalid input, instead of duplicating the menu XML.
Example redirect webhook
POST to the redirect URL
Edge cases and tips
- Elements after
Redirectare dead code. Vobiz stops processing the current document the moment it reachesRedirect. Put fallback logic in the redirect target, not after theRedirectelement. - The target must return valid XML. The redirect URL must respond with a
<Response>document served asapplication/xml. A non-XML or error response drops the call. Redirectvs transferring withDial. UseRedirectto change which of your endpoints controls the call flow (branching, looping, handing off to another service). UseDialto bridge the caller to another party (a phone number or SIP user). To transfer a live call to an agent, return XML from the redirect target that contains aDial- see Transfer a call.- State is not carried automatically.
Redirectposts the standard call parameters but not your application’s own state. Pass context via query parameters on the URL or look it up byCallUUID.