<Scheduler/>

Introduction to <Scheduler/> Tag in Opentact XML

The <Scheduler/> tag in Opentact XML empowers users to dynamically define different call actions or flows based on specific time criteria, such as the day of the week (dow) and time of day. This feature provides the flexibility to execute varying call flows, enhancing user engagement and experience. Let's explore how the <Scheduler/> tag works with a few illustrative examples:

Basic Usage:

<Response>
    <Schedule dow="sun,sat">
        <Say>Try calling on weekdays, please.</Say>
        <Hangup/>
    </Schedule>

    <!-- Additional Scheduling Blocks Can Be Added Here -->

    <Say>Thanks for calling Opentact!</Say>
</Response>

In this example, if a call is received on a Sunday or Saturday, Opentact will execute the specified actions within the <Schedule> block, providing a tailored response.

Time-Based Scheduling:

<Schedule dow="mon,tue,wed,thu,fri" time="00:00:00-06:59:59">
    <Say>Call after 7 am, please.</Say>
    <Hangup/>
</Schedule>

<Schedule dow="mon,tue,wed,thu,fri" time="18:00:00-23:59:59">
    <Say>Call tomorrow, please.</Say>
    <Hangup/>
</Schedule>

Here, the <Scheduler/> tag allows for defining different actions during specific time windows on weekdays. For instance, it instructs callers to wait until after 7 am or to call back the next day during the specified time range.

Dynamic Call Flows:

<Schedule dow="mon,tue,wed,thu,fri" time="07:00:00-18:00:00">
    <Say>Welcome to our service!</Say>
</Schedule>

This scheduling block welcomes callers with a specific message during business hours on weekdays.

Complete Example:

<Response>
    <Schedule dow="sun,sat">
        <Say>Try calling on weekdays, please.</Say>
        <Hangup/>
    </Schedule>

    <Schedule dow="mon,tue,wed,thu,fri" time="00:00:00-06:59:59">
        <Say>Call after 7 am, please.</Say>
        <Hangup/>
    </Schedule>

    <Schedule dow="mon,tue,wed,thu,fri" time="18:00:00-23:59:59">
        <Say>Call tomorrow, please.</Say>
        <Hangup/>
    </Schedule>

    <Schedule dow="mon,tue,wed,thu,fri" time="07:00:00-18:00:00">
        <Say>Welcome to our service!</Say>
    </Schedule>

    <Say>Thanks for calling Opentact!</Say>
</Response>

This comprehensive example showcases the <Scheduler/> tag's versatility, enabling users to define tailored call responses based on both day-of-week and time-of-day criteria.

Last updated