Ctrl K
ring2all.com

Dial Rule Restrictions 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. Pattern Matching
  6. Common Scenarios & Examples
  7. Limitations & Important Notes
  8. Troubleshooting Tips
  9. Glossary

---

1. Module Overview (Technical)

What Are Dial Rule Restrictions?

Dial Rule Restrictions provide pattern-based call control for both outbound and internal calls. Administrators can create restriction profiles with rules that allow or block calls based on dial patterns, optionally requiring passwords, limiting duration, or playing announcements.

Architecture

Plaintext
┌─────────────────────────────────────────────────────────────────┐
│              Dial Rule Restrictions System                      │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│  Call initiated (outbound or internal)                          │
│       │                                                         │
│       ▼                                                         │
│  ┌──────────────────────────────────────────────────────────┐   │
│  │              Load Class of Service Restriction           │   │
│  │  (CoS has dial_rule_restriction_id assigned)            │   │
│  └──────────────────────────────────────────────────────────┘   │
│       │                                                         │
│       ▼                                                         │
│  ┌──────────────────────────────────────────────────────────┐   │
│  │              Evaluate Rules (by priority)                │   │
│  │                                                          │   │
│  │  Rule 1: Pattern 011* | Allowed: NO                      │   │
│  │    └─ Match international → BLOCK                       │   │
│  │                                                          │   │
│  │  Rule 2: Pattern 1900* | Allowed: NO + Announcement      │   │
│  │    └─ Match premium → BLOCK + Play message              │   │
│  │                                                          │   │
│  │  Rule 3: Pattern 1* | Allowed: YES | Max: 1800 sec       │   │
│  │    └─ Match long distance → ALLOW with 30 min limit     │   │
│  │                                                          │   │
│  │  Rule 4: Pattern _X. | Allowed: YES                      │   │
│  │    └─ Fallback → ALLOW all others                       │   │
│  │                                                          │   │
│  └──────────────────────────────────────────────────────────┘   │
│       │                                                         │
│       ▼                                                         │
│  Apply result: ALLOW (with limits) or BLOCK (with message)      │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

Key Tables

TablePurpose
public.dial_rule_restrictionsRestriction profile definitions
public.dial_rule_restriction_rulesIndividual rules within profiles
public.class_of_servicesReferences restriction via dial_rule_restriction_id

Key Files

FileDescription
admin/apps/web/src/modules/dialRuleRestrictions/Frontend module
admin/apps/web/src/i18n/en/dialRuleRestrictions.jsonTranslations
---

2. Module Overview (Commercial/Business)

Business Value

Dial Rule Restrictions enable granular call control:

Without Dial Rule RestrictionsWith Dial Rule Restrictions
All-or-nothing CoS permissionsPattern-specific control
No call duration limitsEnforce time limits
Silent blockingPlay announcements
No password protectionRequire password for patterns

Use Cases

  1. Block Premium/900 Numbers
- Block 1-900- patterns

- Play "This number is restricted" message

  1. International Call Control
- Block all international (011
)

- Allow specific countries with password

  1. Call Duration Limits
- Allow long distance up to 30 minutes

- Play warning before timeout

  1. Internal Extension Control
- Block certain internal ranges

- Restrict after-hours internal calls

Feature Highlights

FeatureBenefit
Pattern MatchingFreeSWITCH wildcards
Allow/BlockPermit or deny per pattern
AnnouncementsCustom audio for blocked calls
Duration LimitsMax call time per pattern
Password RequirementPIN to bypass restriction
Priority OrderingControl rule evaluation
Direction TypeSeparate outbound vs internal
---

3. Module Overview (End User/Administrator)

What Can You Do?

  • Create restriction profiles with multiple rules
  • Allow or block specific dial patterns
  • Set maximum call durations
  • Require passwords for certain patterns
  • Play custom announcements
  • Assign profiles to Class of Service

Administrator Workflow

Plaintext
┌─────────────────────────────────────────────────────────────────┐
│              Creating a Dial Rule Restriction                   │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│  Step 1: Profile Information                                    │
│  ├─ Name: "Standard Restrictions"                              │
│  ├─ Description: "Block premium, limit long distance"          │
│  └─ Enabled: ✓                                                 │
│                                                                 │
│  Step 2: Add Rules                                              │
│                                                                 │
│  ┌───────────────────────────────────────────────────────────┐  │
│  │ Rule 1 (Priority 1) - Block Premium                       │  │
│  │ ├─ Type: Outbound                                         │  │
│  │ ├─ Pattern: 1900*                                         │  │
│  │ ├─ Allowed: ✗                                             │  │
│  │ └─ Announcement: premium_blocked.wav                      │  │
│  └───────────────────────────────────────────────────────────┘  │
│                                                                 │
│  ┌───────────────────────────────────────────────────────────┐  │
│  │ Rule 2 (Priority 2) - Block International                 │  │
│  │ ├─ Type: Outbound                                         │  │
│  │ ├─ Pattern: 011*                                          │  │
│  │ ├─ Allowed: ✗                                             │  │
│  │ └─ Announcement: international_blocked.wav                │  │
│  └───────────────────────────────────────────────────────────┘  │
│                                                                 │
│  ┌───────────────────────────────────────────────────────────┐  │
│  │ Rule 3 (Priority 3) - Limit Long Distance                 │  │
│  │ ├─ Type: Outbound                                         │  │
│  │ ├─ Pattern: 1*                                            │  │
│  │ ├─ Allowed: ✓                                             │  │
│  │ ├─ Max Duration: 1800 seconds (30 min)                    │  │
│  │ └─ Play Max Duration: ✓                                   │  │
│  └───────────────────────────────────────────────────────────┘  │
│                                                                 │
│  ┌───────────────────────────────────────────────────────────┐  │
│  │ Rule 4 (Priority 4) - Allow Everything Else               │  │
│  │ ├─ Type: Outbound                                         │  │
│  │ ├─ Pattern: _X.                                           │  │
│  │ └─ Allowed: ✓                                             │  │
│  └───────────────────────────────────────────────────────────┘  │
│                                                                 │
│  Step 3: Save and Assign to Class of Service                   │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

Quick Tips

TIP
Priority Order: Rules are evaluated top-to-bottom—put specific patterns before wildcards.
TIP
Always Add Fallback: Include a catch-all rule at the end.
CAUTION
Pattern Overlap: More specific patterns should have higher priority (lower number).

---

4. Configuration Fields Reference

Profile Fields

FieldDescriptionExampleRequired
NameProfile identifierStandard RestrictionsYes
DescriptionPurpose notesBlock premiumNo
EnabledProfile active statusOn/OffYes

Rule Fields

FieldDescriptionExample
TypeCall directionOutbound, Internal
PatternDial pattern to match1900, 011, _X.
AllowedAllow or blockOn = Allow, Off = Block
AnnouncementAudio for blocked callspremium_blocked.wav
Play Max DurationAnnounce duration limitOn/Off
Max Duration (sec)Time limit in seconds1800
Require PasswordPIN to proceedOn/Off
PriorityRule evaluation order1, 2, 3...
EnabledRule active statusOn/Off
---

5. Pattern Matching

FreeSWITCH Pattern Syntax

PatternMatchesExample
Zero or more characters1900 matches 1-900-xxx-xxxx
_X.Any digit, one or moreMatches any number
_XAny single digit0-9
_ZDigits 1-9Not 0
_NDigits 2-9Not 0 or 1
[list]Character set[0-9]

Common Patterns

PurposePattern
International (011)011
Premium (1-900)1900
Toll-free (1-800)1800, 1888, 1877
Long distance (1+)1
Local (7/10 digit)_NXXXXXX, _NXXNXXXXXX
All calls_X.
Internal 3-digit_XXX
Internal 4-digit_XXXX
---

6. Common Scenarios & Examples

Scenario 1: Block Premium and International

Profile: "Standard Employee"
PriorityPatternAllowedDescription
11900NoBlock premium
21976NoBlock expensive
3011NoBlock international
4_X.YesAllow all else

Scenario 2: International with Password

Profile: "International with Override"
PriorityPatternAllowedPasswordDescription
11900No-Block premium always
2011YesInternational with PIN
3_X.Yes-Allow all else

Scenario 3: Call Duration Limits

Profile: "Time-Limited"
PriorityPatternAllowedMax DurationDescription
11Yes1800 sec30 min long distance
2011Yes600 sec10 min international
3_X.Yes-Unlimited local

Scenario 4: Internal Extension Controls

Profile: "Lobby Phone"
PriorityTypePatternAllowedDescription
1Internal1YesAllow 1xx extensions
2Internal_X.NoBlock other internal
3Outbound911YesAllow emergency
4Outbound_X.NoBlock all external
---

7. Limitations & Important Notes

Technical Limitations

WARNING
First Match Wins: Only the first matching rule is applied.
WARNING
Profile Assignment: Restrictions must be assigned to Class of Service.

Best Practices

  1. Priority Order: Specific patterns first, wildcards last
  2. Fallback Rule: Always include catch-all at end
  3. Test Patterns: Verify pattern matching before production
  4. Document Rules: Use descriptions for clarity
  5. Announce Blocks: Play message instead of silent hangup

Rule Evaluation

IMPORTANT

Rules are evaluated by priority (1 = first). The first matching rule determines the action.

---

8. Troubleshooting Tips

Common Issues

SymptomPossible CauseSolution
Calls always blockedWrong priority orderPut allow rules before block wildcards
Calls not limitedDuration not enabledCheck Play Max Duration toggle
Wrong pattern matchedPattern overlapAdjust priorities
No announcementAudio file missingVerify file exists

Diagnostic SQL

List restrictions:

Sql
SELECT r.id, r.name, r.enabled,
       (SELECT COUNT(*) FROM public.dial_rule_restriction_rules 
        WHERE dial_rule_restriction_id = r.id) as rule_count
FROM public.dial_rule_restrictions r
WHERE r.domain_id = [domain_id];

Check rules:

Sql
SELECT direction, pattern, allowed, 
       max_duration_seconds, require_password, priority
FROM public.dial_rule_restriction_rules
WHERE dial_rule_restriction_id = [restriction_id]
ORDER BY priority;

---

9. Glossary

TermDefinition
Dial Rule RestrictionProfile containing pattern-based rules
PatternDial string match using FreeSWITCH wildcards
PriorityOrder in which rules are evaluated
Max DurationTime limit for calls matching pattern
AnnouncementAudio played when call is blocked
Password RequirementPIN needed to bypass restriction
DirectionOutbound (external) or Internal
---

Lua Handler Status

⚡ No Dedicated Handler Required

Dial Rule Restrictions is a configuration module. The restriction rules are consumed by the main routing engine during call processing. No dedicated Lua handler exists—the routing engine evaluates rules based on the caller's Class of Service assignment.

---

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?