Ctrl K
ring2all.com

IVR (Interactive Voice Response) Module Documentation

Table of Contents

  1. Module Overview (Technical)
  2. Module Overview (Commercial/Business)
  3. Module Overview (End User/Administrator)
  4. Configuration Fields Reference
  5. IVR Options
  6. Destination Types
  7. Common Scenarios & Examples
  8. Limitations & Important Notes
  9. Troubleshooting Tips
  10. Glossary

---

1. Module Overview (Technical)

What Is an IVR?

An IVR (Interactive Voice Response) is an automated phone menu that plays audio prompts and routes callers based on DTMF key presses. Callers hear options like "Press 1 for Sales, Press 2 for Support" and are routed accordingly.

Architecture

Plaintext
┌─────────────────────────────────────────────────────────────────┐
│                     IVR System                                  │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│  Caller enters IVR (via inbound route or transfer)              │
│       │                                                         │
│       ▼                                                         │
│  ┌──────────────────────────────────────────────────────────┐   │
│  │                     ivr.lua                              │   │
│  │                                                          │   │
│  │  1. Answer call                                          │   │
│  │  2. Play welcome message (ivr-welcome.wav)               │   │
│  │  3. Play instructions (ivr-instructions.wav)             │   │
│  │  4. Wait for DTMF (digit 0-9, *, #)                     │   │
│  │                                                          │   │
│  └──────────────────────────────────────────────────────────┘   │
│       │                                                         │
│       ▼                                                         │
│  ┌──────────────────────────────────────────────────────────┐   │
│  │  User presses "1"                                        │   │
│  │                                                          │   │
│  │  1. Query public.ivrs_options WHERE digit = '1'         │   │
│  │  2. Match found! action=transfer, destination=Sales      │   │
│  │  3. Log statistics (if enabled)                          │   │
│  │  4. Transfer to Sales Queue                              │   │
│  │                                                          │   │
│  └──────────────────────────────────────────────────────────┘   │
│       │                                                         │
│       ▼                                                         │
│  ┌──────────────────────────────────────────────────────────┐   │
│  │  No match or timeout?                                    │   │
│  │                                                          │   │
│  │  1. Play invalid message                                 │   │
│  │  2. Increment retry counter                              │   │
│  │  3. If < max_failures: repeat menu                       │   │
│  │  4. If >= max_failures: play exit message, hangup        │   │
│  │                                                          │   │
│  └──────────────────────────────────────────────────────────┘   │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

Key Tables

TablePurpose
public.ivrsIVR menu definitions
public.ivrs_optionsDTMF options per IVR
public.ivr_statsStatistics tracking
public.dialplan_registryDestination lookup

Key Files

FileDescription
admin/apps/web/src/modules/ivrs/Frontend module
admin/apps/web/src/i18n/en/ivrs.jsonTranslations
telephony/freeswitch/lua/main/xml_handlers/ivr/ivr.luaMain IVR handler
telephony/freeswitch/lua/main/xml_handlers/routing/ivr.luaIVR routing handler
telephony/freeswitch/lua/main/services/ivr_stats_logger.luaStatistics logger
---

2. Module Overview (Commercial/Business)

Business Value

IVRs provide automated call routing:

Without IVRWith IVR
Receptionist answers every callAutomated menu routing
Manual transfersSelf-service navigation
Limited hours24/7 availability
Inconsistent experienceProfessional greeting

Use Cases

  1. Main Auto-Attendant
- Welcome callers

- Route to departments

  1. After-Hours Greeting
- Inform of business hours

- Offer voicemail

  1. Multi-Level Menus
- Sales → Products/Services

- Support → Billing/Technical

  1. Language Selection
- English, Spanish, etc.

- Route to language-specific queues

Feature Highlights

FeatureBenefit
Custom PromptsBranded audio messages
Multiple Options0-9, , # for routing
Nested IVRsMulti-level menus
Direct DialDial extensions from IVR
Timeout HandlingDefault destination
Failure HandlingMax retries limit
StatisticsTrack usage patterns
---

3. Module Overview (End User/Administrator)

What Can You Do?

  • Create IVR menus with audio prompts
  • Configure multiple DTMF options
  • Set timeout and retry limits
  • Route to extensions, queues, other IVRs
  • Enable direct extension dialing
  • Track IVR statistics

Administrator Workflow

Plaintext
┌─────────────────────────────────────────────────────────────────┐
│              Creating an IVR Menu                               │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│  Tab: General                                                   │
│  ├─ Name: "Main Menu"                                          │
│  ├─ Welcome Message: main-welcome.wav                          │
│  ├─ Instructions: main-menu.wav                                │
│  ├─ Invalid Message: invalid-selection.wav                     │
│  ├─ Exit Message: goodbye.wav                                  │
│  ├─ Timeout: 5 seconds                                         │
│  ├─ Max Failures: 3                                            │
│  └─ Enabled: ✓                                                 │
│                                                                 │
│  Tab: Options                                                   │
│  ┌───────────────────────────────────────────────────────────┐  │
│  │ Digits │ Destination        │ Enabled │                  │  │
│  ├────────┼────────────────────┼─────────┤                  │  │
│  │ 1      │ Sales Queue        │ ✓       │                  │  │
│  │ 2      │ Support Queue      │ ✓       │                  │  │
│  │ 3      │ Billing Extension  │ ✓       │                  │  │
│  │ 0      │ Operator (1000)    │ ✓       │                  │  │
│  │ *      │ Repeat Menu        │ ✓       │                  │  │
│  └───────────────────────────────────────────────────────────┘  │
│  [+ Add Option]                                                 │
│                                                                 │
│  Tab: Settings                                                  │
│  ├─ Allow Direct Dial: ✓                                       │
│  ├─ Timeout Destination: Voicemail                             │
│  ├─ Failure Destination: Operator                              │
│  └─ Track Statistics: ✓                                        │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

Quick Tips

TIP
Keep Menus Short: 3-5 options is ideal for caller retention.
TIP
Option 0 = Operator: Standard convention for reaching a human.
CAUTION
Audio File Quality: Use clear, professional recordings.

---

4. Configuration Fields Reference

General Settings

FieldDescriptionDefault
NameIVR identifierRequired
Welcome MessageFirst audio playedivr-welcome.wav
InstructionsMenu options audioivr-instructions.wav
Invalid MessageFor wrong inputivr-invalid.wav
Exit MessageWhen exiting IVRivr-goodbye.wav
Timeout (seconds)Wait for input5
Max FailuresInvalid attempts3
Max TimeoutsTimeout attempts3
EnabledIVR activeOn

Advanced Settings

FieldDescriptionDefault
Inter-Digit TimeoutBetween digits (ms)2000
Min DigitsMinimum input1
Max DigitsMaximum input1
Allow Direct DialDial extensionsOff
Track StatisticsLog usageOff
Record SessionRecord interactionOff
Max Call DurationSession limitNone
Event WebhookAPI notificationNone

Destination Settings

FieldDescription
Timeout DestinationRoute when no input
Failure DestinationRoute after max failures
Background MusicLoop during wait
---

5. IVR Options

Option Configuration

Each IVR can have multiple options:

FieldDescriptionExample
DigitsDTMF trigger1, 2, , #
DestinationWhere to routeSales Queue
EnabledOption activeOn/Off
PriorityEvaluation order1, 2, 3

Common Digit Mappings

DigitTypical Use
1Sales / First option
2Support / Second option
3Billing / Third option
0Operator / Live person
Repeat menu
#Exit / Main menu
9Directory / Dial by name

Example Option Set

Plaintext
IVR: "Main Menu"
├─ 1 → Sales Queue
├─ 2 → Support Queue  
├─ 3 → Billing IVR (sub-menu)
├─ 0 → Operator Extension 1000
├─ * → Repeat (this IVR)
└─ # → Exit

---

6. Destination Types

Available Destinations

TypeDescriptionExample
ExtensionRoute to extension1001
QueueRoute to call center queueSales Queue
IVRRoute to another IVRBilling Menu
Ring GroupRoute to ring groupSupport Team
ConferenceRoute to conferenceMeeting Room
VoicemailRoute to voicemailGeneral Mailbox
Direct RouteExternal number+15055551234
AnnouncementPlay audio, hangupAfter-hours
Feature CodeExecute feature70 (echo test)

Transfer Actions

When an option is selected, the IVR can:

  1. Transfer - Route to destination
  2. IVR - Enter nested IVR menu
  3. Repeat - Replay current menu

---

7. Common Scenarios & Examples

Scenario 1: Simple Auto-Attendant

IVR: "Main Menu"
SettingValue
Welcome"Thank you for calling ABC Company"
Instructions"For Sales press 1, Support press 2, Operator press 0"
Timeout5 seconds
Max Failures3
Options:
DigitDestination
1Sales Queue
2Support Queue
0Extension 1000

Scenario 2: Multi-Level Menu

IVR: "Main Menu"
DigitDestination
1Sales IVR
2Support IVR
IVR: "Sales IVR"
DigitDestination
1New Customers Queue
2Existing Customers Queue
Main Menu (parent)

Scenario 3: After-Hours IVR

IVR: "After Hours"
SettingValue
Welcome"Thank you for calling. Our office is closed."
Instructions"Leave a message after the tone, press 0 for emergency"
Timeout DestinationGeneral Voicemail
Options:
DigitDestination
0On-Call Extension
---

8. Limitations & Important Notes

Technical Notes

NOTE
DTMF Interruption: Callers can press a digit during prompt playback.
WARNING
Audio File Paths: Ensure audio files exist in the language directory.
WARNING
Context Registration: IVR context must be in dialplan_registry.

Best Practices

  1. Professional Audio: Use quality recordings
  2. Short Menus: 3-5 options maximum
  3. Consistent Layout: Option 0 = Operator
  4. Timeout Handling: Always set default destination
  5. Test Thoroughly: Verify all paths work
  6. Track Statistics: Enable for optimization

---

9. Troubleshooting Tips

Common Issues

SymptomPossible CauseSolution
No audioWrong pathCheck audio file exists
DTMF ignoredTiming issueIncrease timeout
Wrong destinationOption misconfiguredCheck option mapping
LoopsCircular IVR referenceReview IVR destinations
No answerIVR not enabledEnable IVR

Diagnostic SQL

List IVRs:

Sql
SELECT id, name, context, timeout, max_failures, enabled
FROM public.ivrs
WHERE domain_id = [domain_id];

Check IVR options:

Sql
SELECT o.digits, o.action, o.destination, o.enabled
FROM public.ivrs_options o
JOIN public.ivrs i ON o.ivr_id = i.id
WHERE i.domain_id = [domain_id] AND i.name = 'Main Menu'
ORDER BY o.priority;

Check IVR statistics:

Sql
SELECT event_type, digit_pressed, destination, COUNT(*)
FROM public.ivr_stats
WHERE ivr_id = [ivr_id]
GROUP BY event_type, digit_pressed, destination
ORDER BY COUNT(*) DESC;

FreeSWITCH Logs

Bash
# Check IVR execution
grep "IVR" /var/log/freeswitch/freeswitch.log
grep "ivr.lua" /var/log/freeswitch/freeswitch.log

---

10. Glossary

TermDefinition
IVRInteractive Voice Response - automated phone menu
DTMFDual-Tone Multi-Frequency - key press tones
ContextIVR identifier for routing
OptionDTMF digit + destination mapping
Nested IVRIVR within IVR (sub-menu)
TimeoutNo input wait time
Max FailuresInvalid input limit
---

Lua Script Status ✅

All Scripts Already Correct

ScriptStatus
ivr/ivr.lua✅ Uses public.domains, public.ivrs, public.ivrs_options, public.dialplan_registry, public.direct_dial
routing/ivr.lua✅ Routing handler
ivr_stats_logger.lua✅ Statistics logger
No Lua fixes needed!

---

Documentation last updated: January 2026*

AI Assistant

👋 Hello! I'm your Ring2All documentation assistant. I can help you find information about configuring and using the Ring2All PBX platform.

How can I help you today?