Time Conditions Module Documentation
Table of Contents
- Module Overview (Technical)
- Module Overview (Commercial/Business)
- Module Overview (End User/Administrator)
- Configuration Fields Reference
- Status Modes
- Common Scenarios & Examples
- Limitations & Important Notes
- Troubleshooting Tips
- Glossary
---
1. Module Overview (Technical)
What Are Time Conditions?
Time Conditions are routing rules that evaluate whether the current time matches a Time Group's schedule. Based on the result, calls are routed to either a "match" destination or a "no-match" destination.
Architecture
Relationship with Time Groups
Key Tables
| Table | Purpose | |
|---|---|---|
public.time_conditions | Condition definitions | |
public.time_groups | Referenced time groups | |
public.time_group_schedules | Schedule entries |
Key Files
| File | Description | |
|---|---|---|
admin/apps/web/src/modules/timeConditions/ | Frontend module | |
admin/apps/web/src/i18n/en/timeConditions.json | Translations | |
telephony/freeswitch/lua/main/xml_handlers/time_condition/time_condition.lua | Main handler | |
telephony/freeswitch/lua/main/xml_handlers/routing/time_condition.lua | Routing handler |
2. Module Overview (Commercial/Business)
Business Value
Time Conditions enable smart time-based routing:
| Without Time Conditions | With Time Conditions | |
|---|---|---|
| Manual route switching | Automatic time routing | |
| 24/7 same experience | Business/after-hours | |
| Staff always needed | Self-service after hours | |
| No holiday handling | Automatic holiday routing |
Use Cases
- Business/After-Hours
- After hours → Voicemail
- Holiday Routing
- Normal days → Standard routing
- Lunch Break
- Normal hours → All agents
- Weekend Support
- Weekends → On-call only
Feature Highlights
| Feature | Benefit | |
|---|---|---|
| Time Group Reference | Reusable schedules | |
| Match/No-Match Routing | Dual destination | |
| Toggle Override | Manual control (code) | |
| BLF Integration | Visual status on phones | |
| Auth PIN | Protected toggle | |
| Multiple Destination Types | Extension, IVR, Queue, etc. |
3. Module Overview (End User/Administrator)
What Can You Do?
- Create time conditions
- Link to Time Groups
- Set match destination (during scheduled time)
- Set no-match destination (outside scheduled time)
- Configure toggle feature code
- Set override status
- Enable BLF indication
Administrator Workflow
Quick Tips
TIP
Use Descriptive Names: "Business Hours Check" is clearer than "TC1".TIP
Toggle Code Convention: Use 81, 82, etc. for easy reference.CAUTION
Always Set Both Destinations: Ensure match AND no-match are configured.---
4. Configuration Fields Reference
General Fields
| Field | Description | Example | |
|---|---|---|---|
| Condition Name | Unique identifier | Business Hours Check | |
| Description | Optional notes | Routes during work hours | |
| Time Group | Schedule to evaluate | Business Hours | |
| Context | Dialplan context | tc_business_hours |
Routing Fields
| Field | Description | |
|---|---|---|
| On Match Module | Destination type when matched | |
| On Match Value | Specific destination | |
| On No Match Module | Destination type when not matched | |
| On No Match Value | Specific destination |
Destination Types
| Type | Description | |
|---|---|---|
| Extension | Route to extension | |
| IVR | Route to IVR menu | |
| Ring Group | Route to ring group | |
| Queue | Route to call queue | |
| Voicemail | Route to voicemail | |
| Hangup | Terminate call |
Override Fields
| Field | Description | Default | |
|---|---|---|---|
| Toggle Code | Feature code to toggle | None | |
| Auth PIN | PIN for toggle protection | None | |
| Status | Current override status | Default | |
| BLF Inverted | Invert BLF indication | Off |
5. Status Modes
Status Options
| Status | Behavior | |
|---|---|---|
| Default (Auto) | Evaluate Time Group schedules | |
| Forced Match | Always route to match destination | |
| Forced No Match | Always route to no-match destination |
Toggle Flow
BLF Integration
| Status | BLF State | BLF Inverted | |
|---|---|---|---|
| Default | Off | On | |
| Forced Match | On | Off | |
| Forced No Match | On | Off |
6. Common Scenarios & Examples
Scenario 1: Business Hours Routing
Time Condition: "Main Line Hours"| Field | Value | |
|---|---|---|
| Time Group | Business Hours (Mon-Fri 9-5) | |
| Match Destination | Main IVR | |
| No-Match Destination | After-Hours Voicemail | |
| Toggle Code | 81 |
- 9am-5pm weekdays → Main IVR
- After hours → After-Hours Voicemail
- User dials 81 → Override toggle
Scenario 2: Holiday Closure
Time Condition: "Holiday Check"| Field | Value | |
|---|---|---|
| Time Group | Holidays 2026 | |
| Match Destination | Holiday Announcement | |
| No-Match Destination | (continue to next TC) |
Scenario 3: Emergency Override
Time Condition: "Emergency Open"| Field | Value | |
|---|---|---|
| Time Group | Always Closed | |
| Match Destination | Hangup | |
| No-Match Destination | Emergency Queue | |
| Toggle Code | 99 | |
| Auth PIN | 5678 |
---
7. Limitations & Important Notes
Technical Notes
NOTE
Timezone: Evaluation uses server timezone.WARNING
Context Conflict: Ensure context names are unique.WARNING
Missing Time Group: Condition fails if group is deleted.Best Practices
- Name Clearly: Use descriptive condition names
- Set Both Destinations: Always configure match AND no-match
- Use Toggle Codes: Enable quick override access
- Protect with PIN: Secure important toggles
- Test Thoroughly: Verify routing at different times
- Document Overrides: Track who has toggle access
---
8. Troubleshooting Tips
Common Issues
| Symptom | Possible Cause | Solution | |
|---|---|---|---|
| Always same route | Forced status active | Check status setting | |
| Time not matching | Wrong time group | Verify time group schedules | |
| Toggle not working | Wrong toggle code | Check toggle code format | |
| PIN rejected | Wrong PIN | Verify auth PIN | |
| Condition not found | Context mismatch | Check context registration |
Diagnostic SQL
List time conditions: Check condition with time group:FreeSWITCH Logs
---
9. Glossary
| Term | Definition | |
|---|---|---|
| Time Condition | Routing rule evaluating time groups | |
| Match | Current time within schedule | |
| No-Match | Current time outside schedule | |
| Toggle Code | Feature code to override status | |
| Forced Status | Manual override (match/no-match) | |
| BLF | Busy Lamp Field - phone status light | |
| Context | Dialplan identifier |
Lua Script Status ✅
Already Fixed (in Time Groups Task)
| Script | Status |
|---|---|
time_condition.lua | ✅ Uses public.domains, public.time_conditions, public.time_group_schedules (fixed from core. schema) |
---
Documentation last updated: January 2026