Authentication Codes Module Documentation
Table of Contents
- Module Overview (Technical)
- Module Overview (Commercial/Business)
- Module Overview (End User/Administrator)
- Configuration Fields Reference
- Code Management
- Common Scenarios & Examples
- Limitations & Important Notes
- Troubleshooting Tips
- Glossary
---
1. Module Overview (Technical)
What Are Authentication Codes?
Authentication Codes are inbound call authentication rules that require callers to enter a valid PIN/code before routing to a destination. If authentication fails, calls are routed to a fail destination.
IMPORTANT
Not to be confused with Authorization Codes!
- Authentication Codes: PIN-protect inbound calls (caller must enter code)
- Authorization Codes: Account codes for outbound call billing
Architecture
Key Tables
| Table | Purpose | |
|---|---|---|
public.authentication_rules | Authentication rule configurations | |
public.authentication_codes | Valid codes for each rule |
Key Files
| File | Description | |
|---|---|---|
admin/apps/web/src/modules/authenticationCodes/ | Frontend module | |
admin/apps/web/src/i18n/en/authenticationCodes.json | Translations |
2. Module Overview (Commercial/Business)
Business Value
Authentication Codes enable access-controlled inbound routing:
| Without Authentication | With Authentication | |
|---|---|---|
| Open access | PIN-protected | |
| Anyone can reach VIP line | Only authorized callers | |
| No security | Verified access | |
| No tracking | Usage logging |
Use Cases
- VIP Line Protection
- Invalid: routed to public queue
- After-Hours Access
- Invalid: routed to voicemail
- Restricted Services
- Invalid: connection refused
- Private Direct Lines
- PIN-protected access
Feature Highlights
| Feature | Benefit | |
|---|---|---|
| Multiple Codes | Different codes per rule | |
| Code Labels | Track who's using which code | |
| Max Attempts | Limit failed attempts | |
| Timeout Control | Entry time limit | |
| Match/Fail Routing | Dual destination | |
| CSV Import | Bulk code management | |
| Usage Tracking | Count per code |
3. Module Overview (End User/Administrator)
What Can You Do?
- Create authentication rules
- Add multiple valid codes per rule
- Set match destination (valid code)
- Set fail destination (invalid/timeout)
- Configure timeout and max attempts
- Import codes from CSV
- Track code usage
Administrator Workflow
Quick Tips
TIP
Use Labels: Add labels to codes to track who's using them.TIP
CSV Import: Bulk import codes using CSV file.CAUTION
Unique Codes: Codes must be unique within each rule.---
4. Configuration Fields Reference
Rule Fields
| Field | Description | Example | |
|---|---|---|---|
| Name | Rule identifier | VIP Line Access | |
| Description | Optional notes | PIN for partners | |
| Context | Dialplan context | auth_vip_line | |
| Instructions Message | Audio prompt | enter_code.wav | |
| Timeout | Entry timeout (seconds) | 10 | |
| Max Attempts | Failed attempt limit | 3 | |
| Enabled | Rule active | On/Off |
Destination Fields
| Field | Description | |
|---|---|---|
| Match Destination Type | Module when code valid | |
| Match Destination Data | Target when code valid | |
| Fail Destination Type | Module when code invalid | |
| Fail Destination Data | Target when code invalid |
Destination Types
| Type | Description | |
|---|---|---|
| Extension | Route to extension | |
| Voicemail | Route to voicemail | |
| IVR | Route to IVR menu | |
| Conference | Route to conference | |
| Queue | Route to call queue | |
| Hangup | Terminate call | |
| Announcement | Play announcement |
Code Fields
| Field | Description | |
|---|---|---|
| Code | PIN to enter | |
| Label | Friendly name | |
| Enabled | Code active | |
| Used Count | Usage tracking |
5. Code Management
Adding Codes
- Go to Codes tab
- Click Add Code
- Enter code (PIN) and optional label
- Save
CSV Import
Import multiple codes from CSV file:
CSV Format: Import Modes:| Mode | Description | |
|---|---|---|
| Skip Existing | Keep existing codes unchanged | |
| Update Existing | Update existing codes with new data | |
| Replace All | Delete all and import fresh |
Usage Tracking
Each code tracks usage count to monitor:
- Which codes are most used
- Inactive codes to disable
- Partner usage patterns
---
6. Common Scenarios & Examples
Scenario 1: VIP Partner Access
Rule: "VIP Partner Line"| Setting | Value | |
|---|---|---|
| Prompt | "Please enter your partner access code" | |
| Timeout | 10 seconds | |
| Max Attempts | 3 | |
| Match → | VIP Support Extension | |
| Fail → | Main IVR |
| Code | Label | |
|---|---|---|
| 1234 | Partner ABC | |
| 5678 | Partner XYZ |
Scenario 2: After-Hours Employee Access
Rule: "After-Hours Access"| Setting | Value | |
|---|---|---|
| Prompt | "Enter your employee PIN" | |
| Timeout | 8 seconds | |
| Max Attempts | 2 | |
| Match → | Night Queue | |
| Fail → | Voicemail |
Scenario 3: Conference PIN
Rule: "Conference Auth"| Setting | Value | |
|---|---|---|
| Prompt | "Enter conference access code" | |
| Timeout | 15 seconds | |
| Max Attempts | 3 | |
| Match → | Conference Bridge | |
| Fail → | Hangup |
7. Limitations & Important Notes
Technical Notes
NOTE
Match First: First matching code wins (order doesn't matter for codes).WARNING
Timeout Impacts: Too short timeout may cause false failures.WARNING
Max Attempts: Set reasonably (2-5) to balance security and usability.Comparison: Authentication vs Authorization Codes
| Aspect | Authentication Codes | Authorization Codes | |
|---|---|---|---|
| Direction | Inbound | Outbound | |
| Purpose | Access control | Billing/Accounting | |
| Who enters | Caller | Extension user | |
| When | Before routing | Before dialing out | |
| Result | Route to destination | Tag CDR for billing |
Best Practices
- Clear Prompts: Use clear audio instructions
- 3 Attempts: Standard max attempts
- 10 Second Timeout: Reasonable entry time
- Label Codes: Track usage by label
- Disable Unused: Revoke old codes promptly
---
8. Troubleshooting Tips
Common Issues
| Symptom | Possible Cause | Solution | |
|---|---|---|---|
| No prompt | Missing audio file | Upload prompt recording | |
| Code rejected | Disabled code | Enable code in list | |
| Too few attempts | Max attempts too low | Increase max attempts | |
| Timeout too fast | Short timeout | Increase timeout seconds | |
| Wrong destination | Misconfigured routing | Check match/fail destinations |
Diagnostic SQL
List authentication rules: List codes for a rule:FreeSWITCH Logs
---
9. Glossary
| Term | Definition | |
|---|---|---|
| Authentication | Verify caller identity with PIN | |
| Code | PIN entered by caller | |
| Rule | Authentication configuration | |
| Max Attempts | Failed tries before fail route | |
| Timeout | Time limit for code entry | |
| Match Destination | Where to route on valid code | |
| Fail Destination | Where to route on invalid code |
Lua Script Status ℹ️
Configuration Module
| Component | Status | |
|---|---|---|
| Authentication Rules | ℹ️ Configuration stored in public.authentication_rules | |
| Authentication Codes | ℹ️ Codes stored in public.authentication_codes |
validate_pin.lua. The rules and codes are read from the database during call processing.
---
Documentation last updated: January 2026