Authorization Codes Module Documentation
Table of Contents
- Module Overview (Technical)
- Module Overview (Commercial/Business)
- Module Overview (End User/Administrator)
- Configuration Fields Reference
- Call Flow / Logic Explanation
- Import/Export Feature
- Common Scenarios & Examples
- Limitations & Important Notes
- Troubleshooting Tips
- Glossary
---
1. Module Overview (Technical)
What Are Authorization Codes?
Authorization Codes allow users to temporarily elevate their Class of Service (CoS) for a single call. By entering a valid authorization code, users gain access to dial destinations normally restricted by their assigned CoS.
Architecture
Key Tables
| Table | Purpose | |
|---|---|---|
public.authorization_codes | Code definitions with CoS mapping | |
public.class_of_services | Referenced CoS for elevation |
Key Files
| File | Description | |
|---|---|---|
admin/apps/web/src/modules/authorizationCodes/ | Frontend module | |
admin/apps/web/src/i18n/en/authorizationCodes.json | Translations | |
telephony/freeswitch/lua/features/authorization_code.lua | Handler |
2. Module Overview (Commercial/Business)
Business Value
Authorization Codes enable controlled access to restricted destinations:
| Without Auth Codes | With Auth Codes | |
|---|---|---|
| Permanent CoS changes | Temporary elevation | |
| IT involvement needed | User self-service | |
| No accountability | Code-based tracking | |
| All or nothing access | Per-call authorization |
Use Cases
- International Calling
- Managers have international auth codes
- One-time international calls without CoS change
- Toll-Free/Premium Bypass
- Auth codes allow approved calls
- Guest/Temporary Access
- Auth codes for specific project needs
- Audit Trail
- CDR includes alias for billing
Feature Highlights
| Feature | Benefit | |
|---|---|---|
| Per-Code CoS | Different codes = different permissions | |
| Alias in CDR | Replaces code in call records | |
| Import/Export | Bulk management via CSV | |
| Active Toggle | Enable/disable without deletion | |
| Multi-tenant | Separate codes per domain |
3. Module Overview (End User/Administrator)
What Can You Do?
- Create authorization codes with CoS assignments
- Set aliases for CDR identification
- Import/export codes via CSV
- Enable/disable codes
Administrator Workflow
User Workflow (Using Auth Code)
Quick Tips
---
4. Configuration Fields Reference
Authorization Code Fields
| Field | Description | Example | Required | |
|---|---|---|---|---|
| Authorization Code | The code users enter | 5678 | Yes | |
| Alias | CDR replacement text | SalesMgr | No | |
| Description | Admin notes | For sales intl calls | No | |
| Class of Service | CoS to apply | International Access | Yes | |
| Active | Code enabled status | On/Off | Yes |
CDR Behavior
When a call uses an authorization code:
- Without Alias: CDR shows raw code (5678)
- With Alias: CDR shows alias text (SalesMgr)
---
5. Call Flow / Logic Explanation
Authorization Code Flow
Channel Variables
| Variable | Description |
|---|---|
override_cos_id | Temporary CoS ID applied to call |
6. Import/Export Feature
CSV Export
Purpose: Backup codes or migrate to another system. Format:CSV Import
Import Modes:| Mode | Behavior | |
|---|---|---|
| Skip existing | Keep current codes, skip duplicates | |
| Update existing | Update alias/description/active if code exists | |
| Replace all | Delete all and import fresh |
code- The authorization codealias- CDR replacement textdescription- Admin notesclassOfService- CoS name (must exist)active- true/false
---
7. Common Scenarios & Examples
Scenario 1: International Access for Managers
Setup:| Code | Alias | CoS |
|---|---|---|
| 8888 | MgrIntl | International Access |
Scenario 2: Project-Based Codes
Setup:| Code | Alias | CoS | Description | |
|---|---|---|---|---|
| 1001 | ProjectAlpha | Long Distance | Alpha team | |
| 1002 | ProjectBeta | Long Distance | Beta team |
Scenario 3: Emergency Override
Setup:| Code | Alias | CoS |
|---|---|---|
| 9999 | EmergencyOverride | Full Access |
---
8. Limitations & Important Notes
Technical Limitations
Best Practices
- Unique Codes: Assign unique codes per user/purpose
- Meaningful Aliases: Use aliases for CDR clarity
- Regular Audits: Review code usage periodically
- Strong Codes: Use 4+ digits, avoid patterns
- Disable vs. Delete: Disable for temporary revocation
Security Considerations
---
9. Troubleshooting Tips
Common Issues
| Symptom | Possible Cause | Solution | |
|---|---|---|---|
| "Feature not allowed" | 79 not in user's CoS | Enable 79 in feature codes | |
| "Invalid code" | Code not found/disabled | Check code exists and is active | |
| Still restricted | override_cos_id not honored | Check routing respects override | |
| No prompt heard | Audio file missing | Check enter_auth_code.wav |
Diagnostic SQL
List authorization codes: Check code usage (if logged):---
10. Glossary
| Term | Definition | |
|---|---|---|
| Authorization Code | Numeric code that temporarily elevates CoS | |
| CoS Elevation | Temporarily granting higher permissions | |
| override_cos_id | Channel variable with elevated CoS ID | |
| Alias | Text that replaces code in CDR | |
| Feature Code | 79 - the dialpad code to invoke authorization |
Lua Script Status ✅
Integration Module
| Component | Status | Location |
|---|---|---|
| Auth Codes Handler | ✅ Active | app/authorization_codes/auth_codes.lua |