This page was last edited on April 6, 2020, at 18:30.
Comments or questions about this documentation? Contact us for support!
You can design a treatment script that takes into account the time of day when determining how to contact a customer. Using predefined daytime intervals and configured Statistical Days and Statistical Tables with a SCXML treatment, OCS can also adjust how a customer is contacted if a daytime switch occurs. For example, the treatment may request that OCS dial a customer's business phone during business hours, but dial the customer's mobile phone after business hours.
The predefined daytime intervals include:
When a dialing session/campaign group loads, OCS reads the time intervals, Statistical Days, and Statistical Tables configuration to determine the current time interval. OCS looks for the Statistical Tables in the configuration database in the following order:
Note: | If these Statistical Tables are not found in either location or a Statistical Day is not configured, OCS considers the time range as a holiday (HDAY). |
At startup, OCS determines the time and identifies the daytime interval according to the configured Statistical Days and Statistical Tables (see the procedure Configuring Statistical Days and Statistical Tables for Time Ranges). OCS dynamically processes configuration time interval changes (for example, from BH to ABH), while a Campaign Group is active. When the daytime interval changes, according to the contact's time zone, OCS informs the various instances of the state machine by sending the ocs.daytime_change event (see the Events from OCS table). This triggers the state machine to proceed to the new daytime interval.
In addition, when the SCXML engine downloads a script, the state machine requests the current daytime interval through the get_daytime action (see the Events from OCS table).
When designing your SCXML treatment to handle daytime intervals and switching, include the following:
You can also configure the script to delay switching of time intervals if the daytime switch occurs while a particular substate is still being processed (for example, the state machine is waiting for the ocs.callresult event). To accomplish this, configure the script to store the daytime interval in a variable and have the script check that variable when it is in a state for processing a daytime change.
To simplify the script design, you might create one high level script and multiple individual scripts to handle each daytime interval. When the daytime switching occurs, the current time interval script will be stopped and the new daytime interval script started. Then in the high level script, include a reference in the script to an external file located at another URL using the src attribute. For example:
<state id="ABH" src="someURL#ABH">
When OCS requests a download of the script, the SCXML engine downloads the script and all referenced scripts into one combined state machine. As usual, an instance of this is created for each record/chain processed.
Note: | For an example of a script which handles daytime intervals, see the sample treatment script, sample03.scxml, that installs with OCS. |