<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:

Tag NameRequiredDescription

url

YES

This is the URL that Opentact will query to obtain the Dialplan XML.

body

NO

Default is false. If set to true, Opentact will include Call Control APP data in the query's body.

timeout

NO

This is the max time before Opentact will time out. If no response is received within the timeout value, Opentact will execute the <Error> block.

tag

NO

If specified, this tag value will be sent to the callback url in the tag field.

method

YES

Thid value must be one of : "POST", "GET", "PATCH" and "DELETE"

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

Field NameDescription

call

Call UUID

sca

Call Control APP UUID

state

State of the Call. Most likely it is "live"

from

The caller ID of the call

tn

The number being called to

tag

This is the tag specified in the xml.

Last updated