Dynamic Routing Module Documentation
Table of Contents
- Module Overview (Technical)
- Module Overview (Commercial/Business)
- Module Overview (End User/Administrator)
- Configuration Fields Reference
- How It Works
- Common Scenarios & Examples
- Limitations & Important Notes
- Troubleshooting Tips
- Glossary
---
1. Module Overview (Technical)
What Is Dynamic Routing?
Dynamic Routing (also called "Callback on No Answer") is a feature that automatically routes inbound calls to the extension that previously called the caller. When an extension makes an outbound call that goes unanswered, the system registers the caller ID. If that person calls back, they're automatically routed to the original extension.
Architecture
Key Tables
| Table | Purpose | |
|---|---|---|
public.dynamic_routing_configs | Per-domain configuration | |
public.dynamic_route_entries | Pending callback entries | |
public.sip_extensions | Extension settings (dynamic_routing_enabled) |
Key Files
| File | Description | |
|---|---|---|
admin/apps/web/src/modules/dynamicRouting/ | Frontend module | |
admin/apps/web/src/i18n/en/dynamicRouting.json | Translations | |
telephony/freeswitch/lua/resources/functions/dynamic_routing_utils.lua | Shared utilities | |
telephony/freeswitch/lua/resources/functions/dynamic_routing_register.lua | Outbound registration | |
telephony/freeswitch/lua/main/xml_handlers/dialplan/route_with_fallback.lua | Inbound matching |
2. Module Overview (Commercial/Business)
Business Value
Dynamic Routing provides automatic callback recognition:
| Without Dynamic Routing | With Dynamic Routing | |
|---|---|---|
| Callback goes to main IVR | Callback goes to original caller | |
| Caller navigates menus | Direct connection | |
| Receptionist routing | Automatic routing | |
| Poor callback experience | Seamless callback |
Use Cases
- Sales Teams
- Prospect calls back → routed to same rep
- Better customer relationships
- Support Teams
- Customer returns call → same tech
- Continuity of service
- Personal Extensions
- Callback routed to their extension
- Personal call management
Feature Highlights
| Feature | Benefit | |
|---|---|---|
| Automatic Registration | No manual setup | |
| Missed Calls Only | Register unanswered calls | |
| Configurable Expiration | Time-limited matching | |
| Digits Match | Flexible caller ID matching | |
| Per-Extension Enable | Selective activation | |
| Auto-Delete | Clean up after callback |
3. Module Overview (End User/Administrator)
What Can You Do?
Domain Configuration:- Set digits to match (caller ID suffix)
- Configure expiration time
- Enable/disable delete after use
- Enable/disable missed calls only
- Enable dynamic routing per extension
- View active callback entries
- Delete entries manually
- Search by caller ID or extension
Administrator Workflow
Extension Enable
In Extension settings:
Quick Tips
---
4. Configuration Fields Reference
Domain Configuration
| Field | Description | Default | |
|---|---|---|---|
| Digits to Match | Last N digits of caller ID to use | 7 | |
| Expiration (Minutes) | How long entries remain valid | 60 | |
| Delete Used Records | Remove entry after callback routed | On | |
| Only Keep Missed Calls | Only register unanswered calls | On |
Digits Match Examples
| Caller ID | Digits Match | Token Stored | |
|---|---|---|---|
| +15055551234 | 7 | 5551234 | |
| +15055551234 | 10 | 5055551234 | |
| +15055551234 | 0 (blank) | 15055551234 |
Missed Call Detection
These hangup causes register an entry:
NO_ANSWERUSER_BUSYCALL_REJECTEDORIGINATOR_CANCELNO_USER_RESPONSESUBSCRIBER_ABSENTDESTINATION_OUT_OF_ORDER
Extension Settings
| Field | Description |
|---|---|
| Dynamic Routing Enabled | Enable callback registration for this extension |
5. How It Works
Registration Flow (Outbound)
Matching Flow (Inbound)
Token Matching Logic
---
6. Common Scenarios & Examples
Scenario 1: Sales Rep Callback
Configuration:| Setting | Value | |
|---|---|---|
| Digits Match | 7 | |
| Expiration | 120 min | |
| Delete Used | ✓ | |
| Only Missed | ✓ |
- Sales rep 1001 calls prospect
- Prospect doesn't answer
- Entry created: 5551234 → 1001
- Prospect calls back 30 min later
- Routed directly to extension 1001
Scenario 2: Support Technician
Configuration:| Setting | Value | |
|---|---|---|
| Digits Match | 10 | |
| Expiration | 480 min (8 hours) | |
| Delete Used | ✓ | |
| Only Missed | Off |
- Tech 1002 calls customer, call answered
- Entry created (even though answered)
- Customer calls back later
- Routed to same tech
Scenario 3: High Volume Call Center
Configuration:| Setting | Value | |
|---|---|---|
| Digits Match | 7 | |
| Expiration | 30 min | |
| Delete Used | ✓ | |
| Only Missed | ✓ |
- Short expiration to reduce false matches
- Only missed calls to reduce entries
- Auto-delete to keep table clean
---
7. Limitations & Important Notes
Technical Notes
LIKE '%token' for flexible matching.Best Practices
- Use 7-10 Digits: Balances flexibility and accuracy
- Set Reasonable Expiration: 1-2 hours typical
- Enable Delete Used: Prevents stale entries
- Enable Only Missed: Reduces unnecessary entries
- Test Before Production: Verify matching works correctly
---
8. Troubleshooting Tips
Common Issues
| Symptom | Possible Cause | Solution | |
|---|---|---|---|
| No entry created | Extension not enabled | Enable dynamic_routing_enabled | |
| Entry not created | Call was answered | Check only_keep_missed_calls | |
| No match found | Digits don't match | Adjust digits_match | |
| Entry expired | Expiration too short | Increase expiration_minutes | |
| Wrong extension | Digits too few | Increase digits_match |
Diagnostic SQL
Check domain configuration: List pending entries: Check extension setting:FreeSWITCH Logs
---
9. Glossary
| Term | Definition | |
|---|---|---|
| Dynamic Routing | Automatic callback-to-extension routing | |
| Token | Normalized caller ID digits stored for matching | |
| Digits Match | Number of digits to extract from caller ID | |
| Expiration | How long an entry remains valid | |
| Delete Used | Remove entry after successful callback | |
| Only Missed | Only register unanswered outbound calls |
Lua Script Status ✅
All Scripts Already Correct
| Script | Status | |
|---|---|---|
dynamic_routing_utils.lua | ✅ Uses public.dynamic_routing_configs, public.sip_extensions, public.dynamic_route_entries | |
dynamic_routing_register.lua | ✅ Uses utilities with correct schema | |
route_with_fallback.lua | ✅ Uses utilities for inbound matching |
---
Documentation last updated: January 2026