Ctrl K
ring2all.com

Call Flows 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. Status Toggle
  6. Common Scenarios & Examples
  7. Limitations & Important Notes
  8. Troubleshooting Tips
  9. Glossary

---

1. Module Overview (Technical)

What Are Call Flows?

Call Flows are toggleable routing switches that route calls to different destinations based on a binary state (enabled/disabled). Users can toggle the state via feature codes or BLF buttons to control call routing.

Architecture

Plaintext
┌─────────────────────────────────────────────────────────────────┐
│                    Call Flow System                             │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│  Call Flow: "Night Mode" - Status: ENABLED                      │
│  ┌────────────────────────────────────────────────────────────┐ │
│  │ Toggle Code: *60                                          │ │
│  │                                                            │ │
│  │ When ENABLED (current):                                   │ │
│  │   → Route to After-Hours Voicemail                        │ │
│  │                                                            │ │
│  │ When DISABLED:                                             │ │
│  │   → Route to Main IVR                                     │ │
│  │                                                            │ │
│  └────────────────────────────────────────────────────────────┘ │
│                                                                 │
│  ┌────────────────────────────────────────────────────────────┐ │
│  │                  call_flow.lua                             │ │
│  │                                                            │ │
│  │  Mode: Toggle (*60)                                        │ │
│  │    1. User dials *60                                       │ │
│  │    2. Query public.call_flows by feature_code              │ │
│  │    3. Flip status: enabled ↔ disabled                     │ │
│  │    4. Update BLF state                                     │ │
│  │    5. Play confirmation audio                              │ │
│  │                                                            │ │
│  │  Mode: Route (inbound call)                                │ │
│  │    1. Call arrives at call flow                            │ │
│  │    2. Check current status                                 │ │
│  │    3. Route to enabled/disabled destination                │ │
│  │                                                            │ │
│  └────────────────────────────────────────────────────────────┘ │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

Key Tables

TablePurpose
public.call_flowsCall flow definitions and status
public.domainsDomain resolution
public.sip_extensionsExtension CoS lookup
public.feature_code_numbersFeature code validation
public.feature_code_cos_membersCoS permissions

Key Files

FileDescription
admin/apps/web/src/modules/callFlows/Frontend module
admin/apps/web/src/i18n/en/callFlows.jsonTranslations
telephony/freeswitch/lua/main/xml_handlers/call_flow/call_flow.luaMain handler
telephony/freeswitch/lua/main/xml_handlers/routing/call_flow.luaRouting handler
---

2. Module Overview (Commercial/Business)

Business Value

Call Flows provide on-demand routing control:

Without Call FlowsWith Call Flows
Fixed routingDynamic switching
Admin-only changesUser toggle via phone
No quick overrideInstant BLF toggle
Manual updatesOne-button control

Use Cases

  1. Night Mode
- Enable: Route to voicemail

- Disable: Route to normal IVR

  1. Holiday Routing
- Enable: Route to holiday message

- Disable: Route to standard menu

  1. Emergency Overflow
- Enable: Route to backup queue

- Disable: Route to primary queue

  1. Do Not Disturb
- Enable: Route to voicemail

- Disable: Route to extension

Feature Highlights

FeatureBenefit
Two DestinationsEnabled/Disabled routing
Feature Code ToggleDial 60 to toggle
BLF IntegrationVisual status on phones
Toggle All (81)Mass enable/disable
CoS ProtectionPermission-based toggle
Auto-ScheduleTime-based switching
---

3. Module Overview (End User/Administrator)

What Can You Do?

  • Create call flows with two destinations
  • Set feature code for toggle (60, 81, etc.)
  • View and change current status
  • Configure enabled/disabled destinations
  • Set up auto-schedule
  • Restrict toggle to specific extensions

Administrator Workflow

Plaintext
┌─────────────────────────────────────────────────────────────────┐
│              Creating a Call Flow                               │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│  Tab: General                                                   │
│  ├─ Name: "Night Mode"                                         │
│  ├─ Feature Code: *60                                          │
│  ├─ Current Status: [Disabled] ← Toggle button                 │
│  ├─ Allow Manual Toggle: ✓                                     │
│  └─ Enabled: ✓                                                 │
│                                                                 │
│  Section: Destinations                                          │
│  ┌───────────────────────────────────────────────────────────┐  │
│  │ When Enabled:                                             │  │
│  │ ├─ Destination Type: Voicemail                            │  │
│  │ └─ Destination: General Mailbox                           │  │
│  └───────────────────────────────────────────────────────────┘  │
│  ┌───────────────────────────────────────────────────────────┐  │
│  │ When Disabled:                                            │  │
│  │ ├─ Destination Type: IVR                                  │  │
│  │ └─ Destination: Main Menu                                 │  │
│  └───────────────────────────────────────────────────────────┘  │
│                                                                 │
│  Tab: Advanced Settings                                         │
│  ├─ Announcement Path (ON): night-mode-enabled.wav             │
│  ├─ Announcement Path (OFF): night-mode-disabled.wav           │
│  ├─ Play Announcement Before Transfer: Off                     │
│  ├─ Auto-Schedule Enabled: Off                                 │
│  └─ BLF Update Behavior: Sync                                  │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

Quick Tips

TIP
BLF Button: Assign 60 to a BLF button for one-touch toggling with visual feedback.
TIP
Toggle All (
81): Use to enable/disable all call flows at once.
CAUTION
Both Destinations Required: Configure both enabled and disabled destinations.

---

4. Configuration Fields Reference

General Fields

FieldDescriptionExample
NameUnique identifierNight Mode
Feature CodeToggle dial code60
Current StatusEnabled/DisabledToggle button
Allow Manual TogglePermit user toggleOn/Off
EnabledCall flow activeOn/Off

Destination Fields

FieldDescription
Enabled Destination TypeModule when status=enabled
Enabled Destination ValueTarget when status=enabled
Disabled Destination TypeModule when status=disabled
Disabled Destination ValueTarget when status=disabled

Destination Types

TypeDescription
ExtensionRoute to extension
VoicemailRoute to voicemail
IVRRoute to IVR menu
ConferenceRoute to conference
QueueRoute to call queue
HangupTerminate call
AnnouncementPlay announcement

Advanced Settings

FieldDescriptionDefault
DescriptionOptional notes-
Announcement Path (ON)Audio when enabledNone
Announcement Path (OFF)Audio when disabledNone
Play AnnouncementBefore transferOff
Auto-Schedule EnabledTime-based toggleOff
BLF Update BehaviorSync/Manual/NoneSync
State Change WebhookNotification URLNone
Restrict Toggle ToExtension whitelistNone
Record CallRecord routed callsOff
Max Call DurationTime limitNone
---

5. Status Toggle

Toggle Methods

MethodDescription
Feature CodeDial 60 to toggle
BLF ButtonPress button on phone
Admin PanelClick toggle in UI
Toggle All (81)Toggle all flows

Toggle Flow

Plaintext
User dials *60
    │
    ▼
┌─────────────────────────────┐
│   call_flow.lua             │
│                             │
│   1. Query call flow by *60 │
│   2. Current status: OFF    │
│   3. Flip to: ON            │
│   4. Update database        │
│   5. Update BLF             │
│   6. Play confirmation      │
│                             │
└─────────────────────────────┘
    │
    ▼
Status: ON
BLF Light: Red/Lit
Audio: "Call flow enabled"

BLF Integration

StatusBLF StateVisual
EnabledOnRed/Lit
DisabledOffGreen/Off
---

6. Common Scenarios & Examples

Scenario 1: Night Mode

Call Flow: "Night Mode"
SettingValue
Feature Code60
Enabled DestinationVoicemail (General)
Disabled DestinationIVR (Main Menu)
Usage:
  1. At close of business: Dial 60 → Night mode ON
  2. In morning: Dial 60 → Night mode OFF

Scenario 2: Holiday Routing

Call Flow: "Holiday"
SettingValue
Feature Code61
Enabled DestinationAnnouncement (Holiday Message)
Disabled DestinationIVR (Main Menu)

Scenario 3: Emergency Overflow

Call Flow: "Overflow Mode"
SettingValue
Feature Code62
Enabled DestinationQueue (Backup Support)
Disabled DestinationQueue (Primary Support)
---

7. Limitations & Important Notes

Technical Notes

NOTE
CoS Required: Toggle actions require Class of Service permission.
WARNING
Both Destinations: Always configure both enabled and disabled destinations.
WARNING
Feature Code Unique: Ensure feature codes don't conflict.

Best Practices

  1. Clear Names: Use descriptive names like "Night Mode"
  2. BLF Buttons: Assign to frequently toggled flows
  3. Confirm Audio: Enable toggle announcements
  4. Test Both States: Verify routing in both states
  5. Document Codes: Keep list of feature codes

---

8. Troubleshooting Tips

Common Issues

SymptomPossible CauseSolution
Toggle not workingCoS restrictionCheck feature code permissions
Wrong destinationStatus mismatchVerify current status
BLF not updatingBLF behavior settingSet to "Sync"
Feature code conflictDuplicate codeUse unique code
No audioMissing audio fileCheck announcement path

Diagnostic SQL

List call flows:

Sql
SELECT id, name, feature_code, status, 
       enabled_destination_module, enabled_destination_data,
       disabled_destination_module, disabled_destination_data
FROM public.call_flows
WHERE domain_id = [domain_id];

Check call flow status:

Sql
SELECT name, status, toggle_enabled, enabled
FROM public.call_flows
WHERE domain_id = [domain_id] AND feature_code = '*60';

FreeSWITCH Logs

Bash
# Check call flow toggle
grep "CallFlow" /var/log/freeswitch/freeswitch.log
grep "call_flow.lua" /var/log/freeswitch/freeswitch.log

---

9. Glossary

TermDefinition
Call FlowToggleable routing switch
StatusCurrent state (enabled/disabled)
Feature CodeDial code to toggle (60)
ToggleSwitch between enabled/disabled
BLFBusy Lamp Field - phone status light
Toggle AllEnable/disable all flows (81)
---

Lua Script Status ✅

Fixed in This Session

ScriptStatus
call_flow/call_flow.luaFixed: Changed from core.call_flows, core.tenants, core.sip_users, core.feature_code_ to public.call_flows, public.domains, public.sip_extensions, public.feature_code_. Also fixed tenant_id to domain_id and update_at to updated_at.
Lua fixes applied!

---

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?