<Geo/>

Introduction to <Geo/> Tag in Opentact XML

The <Geo/> tag in Opentact XML provides a powerful mechanism to filter incoming calls based on their Caller ID attributes, such as states or counties. This enables users to tailor call responses according to the geographical origin of the caller. Let's explore how the <Geo/> tag works with a few examples:

Basic Usage:

<Geo states="NJ">
    <Say text="Hello New Jersey"/>
</Geo>

In this example, if the Caller ID indicates a state of New Jersey, Opentact will execute the action specified within the <Geo> tag, responding with a greeting tailored to New Jersey callers.

Handling Multiple States:

<Geo states="AL,OK">
    <Say text="Hello Alaska or Outland"/>
</Geo>

This <Geo> tag accommodates callers from either Alaska or Oklahoma. The contained action will be executed for callers from these specified states.

Counties and States Combination:

<Geo states="NJ,CA" county="ESSEX">
    <Say text="Hello Essex County, New Jersey"/>
</Geo>

In this example, Opentact not only filters by states (New Jersey and California) but also refines the filter by including callers from Essex County, New Jersey. The response is tailored to this specific geographical criterion.

Unfiltered Execution:

<Geo>
    <!-- This block is executed without any specific filters -->
</Geo>

When no filters are specified within the <Geo> tag, the contained action is executed for all incoming calls, providing a default response or action.

Full Example:

<Response>
    <Say tag="greeting">Thanks for calling Opentact!</Say>

    <Geo states="NJ">
        <Say text="Hello New Jersey"/>
    </Geo>

    <Geo states="CA">
        <Say text="Hello California"/>
    </Geo>

    <Geo>
        <!-- This block would be executed for all calls -->
    </Geo>

    <Geo states="AL,OK">
        <Say text="Hello Alaska or Outland"/>
    </Geo>

    <Geo states="NJ,CA" county="ESSEX">
        <Say text="Hello Essex County, New Jersey"/>
    </Geo>
</Response>

This comprehensive example demonstrates various use cases of the <Geo/> tag within an Opentact XML response, showcasing the flexibility it provides for call customization based on geographical attributes.

Last updated