Skip to main content
The 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 the Speak element finishes, Vobiz requests the redirect URL and runs whatever XML it returns.
<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Speak>Please wait while we transfer your call.</Speak>
    <Redirect>https://yourapp.com/next-step</Redirect>
</Response>

Loop back to a menu

Use Redirect to re-present an IVR menu after invalid input, instead of duplicating the menu XML.
<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Speak>Sorry, that is not a valid option.</Speak>
    <Redirect method="POST">https://yourapp.com/answer</Redirect>
</Response>

Example redirect webhook

POST to the redirect URL
POST /next-step HTTP/1.1
Host: yourapp.com
Content-Type: application/x-www-form-urlencoded

From=14155551234&To=14155559999&CallUUID=xyz789&Event=Redirect&Direction=inbound&CallStatus=in-progress&CallerName=Jane+Doe

Edge cases and tips

  • Elements after Redirect are dead code. Vobiz stops processing the current document the moment it reaches Redirect. Put fallback logic in the redirect target, not after the Redirect element.
  • The target must return valid XML. The redirect URL must respond with a <Response> document served as application/xml. A non-XML or error response drops the call.
  • Redirect vs transferring with Dial. Use Redirect to change which of your endpoints controls the call flow (branching, looping, handing off to another service). Use Dial to 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 a Dial - see Transfer a call.
  • State is not carried automatically. Redirect posts the standard call parameters but not your application’s own state. Pass context via query parameters on the URL or look it up by CallUUID.