<Callback/>

Introduction to <Callback> Tag in Opentact XML

The <Callback> tag in Opentact XML plays a crucial role in dynamically obtaining call flow information from a specified URL. This powerful feature allows users to customize the call handling process by fetching the call flow XML remotely.

How <Callback> Works:

When included in a Call Control XML, the <Callback> tag is used to define the URL from which Opentact should retrieve the call flow XML. This URL typically points to an endpoint that generates and returns the desired call flow instructions.

Example Usage:

<Callback url="https://api.opentact.org/rest/call_flow" />

In this example, Opentact will make a request to the specified URL (https://api.opentact.org/rest/call_flow) to fetch the call flow XML. The retrieved XML will then be processed for call handling.

Handling Errors:

The content within the <Callback> tag is primarily focused on error handling scenarios. If, for any reason, Opentact encounters issues fetching or parsing the response from the specified URL, it will execute the defined error block within the <Callback>.

Example Error Handling:

<Callback url="https://api.callify.io/opentact/callflow">
    <Error>
        <Say text="An error occurred"/>
        <Hangup/>
    </Error>
</Callback>

In this scenario, if an error occurs during the callback process, Opentact will say "An error occurred" and subsequently hang up the call.

Parameters:

The <Callback> tag can include various parameters, influencing how Opentact interacts with the specified URL. These parameters ensure flexibility and customization in the call flow retrieval process.

The <Callback> XML tab has the following parameters:

When Opentact trigger an outbound query to the callback URL, the following fields will be included:

Last updated