Ctrl K
ring2all.com

PIN Lists 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. Call Flow / Logic Explanation
  6. Import/Export Feature
  7. Common Scenarios & Examples
  8. Limitations & Important Notes
  9. Troubleshooting Tips
  10. Glossary

---

1. Module Overview (Technical)

What Are PIN Lists?

PIN Lists provide authorization codes for controlled access to specific telephony features. Users must enter a valid PIN from the list to proceed with protected actions like international calls, DISA access, or restricted routes.

Architecture

Plaintext
┌─────────────────────────────────────────────────────────────────┐
│                    PIN List Validation System                   │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│  Feature requests PIN validation (e.g., international call)    │
│       │                                                         │
│       ▼                                                         │
│  ┌──────────────────────────────────────────────────────────┐   │
│  │              Dialplan sets pin_list variable             │   │
│  │  session:setVariable("pin_list", "international")        │   │
│  └──────────────────────────────────────────────────────────┘   │
│       │                                                         │
│       ▼                                                         │
│  ┌──────────────────────────────────────────────────────────┐   │
│  │              validate_pin.lua                            │   │
│  │                                                          │   │
│  │  1. Look up PIN list by name and domain                  │   │
│  │     SELECT id FROM public.pin_lists                      │   │
│  │     WHERE name = 'international' AND enabled = TRUE      │   │
│  │                                                          │   │
│  │  2. Prompt user: "Enter your access PIN"                 │   │
│  │                                                          │   │
│  │  3. Validate entered PIN against members                 │   │
│  │     SELECT 1 FROM public.pin_list_members                │   │
│  │     WHERE pin = [input] AND enabled = TRUE               │   │
│  │                                                          │   │
│  │  4. Set result variable                                  │   │
│  │     session:setVariable("pin_list_valid", "true/false")  │   │
│  │                                                          │   │
│  └──────────────────────────────────────────────────────────┘   │
│       │                                                         │
│       ▼                                                         │
│  Dialplan continues or blocks based on pin_list_valid           │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

Key Tables

TablePurpose
public.pin_listsPIN list definitions (name, enabled)
public.pin_list_membersIndividual PINs within each list

Key Files

FileDescription
admin/apps/web/src/modules/pinLists/Frontend module
admin/apps/web/src/i18n/en/pinLists.jsonEnglish translations
telephony/freeswitch/lua/main/xml_handlers/pin/validate_pin.luaPIN validation handler
---

2. Module Overview (Commercial/Business)

Business Value

PIN Lists enable controlled access to premium or restricted features:

Without PIN ListsWith PIN Lists
All users can dial internationalOnly authorized users
No accountabilityTrack who used which PIN
No cost controlLimit expensive calls
No department segregationDepartment-specific access

Use Cases

  1. International Dialing Authorization
- Only managers can dial international

- PIN required before outbound connects

  1. DISA Security Layer
- Additional PIN after DISA authentication

- Two-factor for extra security

  1. Toll-Free Bypass
- Require PIN for toll-free abuse prevention

- Track usage by PIN

  1. Department Budgets
- Different PIN lists per department

- Track call costs by department

Feature Highlights

FeatureBenefit
Multiple PINs per ListShare list with many users
PIN DescriptionsTrack who owns each PIN
Enable/DisableTemporarily revoke access
Import/ExportBulk management via CSV
Multi-tenantSeparate lists per domain
---

3. Module Overview (End User/Administrator)

What Can You Do?

  • Create PIN lists for different purposes
  • Add multiple PINs to each list
  • Enable/disable individual PINs
  • Import/export PINs via CSV
  • Search and filter PINs

Administrator Workflow

Plaintext
┌─────────────────────────────────────────────────────────────────┐
│                 Creating a PIN List                             │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│  Step 1: General Information                                    │
│  ├─ List Name: "International Access"                          │
│  ├─ Description: "PINs for international dialing"              │
│  └─ Enabled: ✓                                                 │
│                                                                 │
│  Step 2: Add PINs                                               │
│  ├─ PIN: 1234   | Description: "John Smith"    | Enabled: ✓   │
│  ├─ PIN: 5678   | Description: "Jane Doe"      | Enabled: ✓   │
│  ├─ PIN: 9012   | Description: "Sales Team"    | Enabled: ✓   │
│  └─ PIN: 3456   | Description: "Guest Access"  | Enabled: ✗   │
│                                                                 │
│  Step 3: Save                                                   │
│                                                                 │
│  Result: Users entering 1234, 5678, or 9012 pass validation    │
│          User entering 3456 fails (disabled)                   │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

User Workflow (Using PIN)

Plaintext
1. User dials international number
2. System: "Enter your access PIN"
3. User enters: 1234#
4. PIN validated against "International Access" list
5. If valid → Call proceeds
6. If invalid → "Invalid PIN" → Hangup

Quick Tips

TIP
Unique PINs: Use different PINs per user for accountability tracking.
TIP
PIN Length: Use at least 4 digits for security.
CAUTION
Disabled vs. Deleted: Disable PINs for temporary revocation; delete only for permanent removal.

---

4. Configuration Fields Reference

PIN List Fields

FieldDescriptionExampleRequired
List NameUnique identifierInternational AccessYes
DescriptionPurpose notesPINs for internationalNo
EnabledList active statusOn/OffYes

PIN Member Fields

FieldDescriptionExampleRequired
PINAccess code1234Yes
DescriptionOwner/purposeJohn SmithNo
EnabledPIN active statusOn/OffYes

PIN Format

CharactersExampleNotes
Digits 0-91234Standard
Special #123#Advanced
Letters A-ZABC123Rare
Max length16 charsConfigurable
---

5. Call Flow / Logic Explanation

PIN Validation Flow

Plaintext
┌─────────────────────────────────────────────────────────────────┐
│                    PIN Validation Flow                          │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│  1. Dialplan triggers PIN validation                            │
│     session:execute("lua", "validate_pin.lua")                  │
│     with pin_list = "international"                             │
│     │                                                           │
│     ▼                                                           │
│  2. Resolve domain_id from domain_name                          │
│     ├─ Found → Continue                                        │
│     └─ Not found → "Feature not available" → Hangup            │
│     │                                                           │
│     ▼                                                           │
│  3. Look up PIN list by name                                    │
│     SELECT id FROM public.pin_lists                             │
│     WHERE domain_id = X AND name = 'international'              │
│       AND enabled = TRUE                                        │
│     ├─ Found → Continue                                        │
│     └─ Not found → "Feature not available" → Hangup            │
│     │                                                           │
│     ▼                                                           │
│  4. Prompt for PIN                                              │
│     Play: "enter_pin.wav"                                       │
│     Read: up to max_digits, timeout                             │
│     │                                                           │
│     ▼                                                           │
│  5. Validate entered PIN                                        │
│     SELECT 1 FROM public.pin_list_members                       │
│     WHERE pin_list_id = X AND pin = [input] AND enabled = TRUE  │
│     │                                                           │
│     ▼                                                           │
│  6. Set result                                                  │
│     ├─ Found → pin_list_valid = "true" → Continue call         │
│     └─ Not found → pin_list_valid = "false" → Hangup           │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

Channel Variables

VariableDirectionDescription
pin_listInputName of PIN list to validate against
pin_max_digitsInputMaximum PIN length (default: 6)
pin_timeoutInputMilliseconds to wait for input (default: 5000)
pin_list_validOutputResult: "true" or "false"
---

6. Import/Export Feature

CSV Export

Purpose: Backup PIN lists or migrate to another system. Format:

Csv
name,description,pin,pinDescription,enabled
International Access,PINs for international,1234,John Smith,true
International Access,PINs for international,5678,Jane Doe,true
Sales Codes,Sales team access,9012,Sales Team,true

CSV Import

Import Modes:
ModeBehavior
Skip duplicatesIgnore existing lists, only create new
Update existingUpdate existing lists, create new ones
Replace allDelete all existing, import fresh
Process:
  1. Click Import button
  2. Select CSV file
  3. Choose import mode
  4. Review row count
  5. Click Import

---

7. Common Scenarios & Examples

Scenario 1: International Dialing Control

PIN List:
List NamePINs
International Access1234 (CEO), 5678 (CFO), 9012 (Sales Dir)
Dialplan:

Xml
<extension name="international-check">
  <condition field="destination_number" expression="^011(.*)$">
    <action application="set" data="pin_list=International Access"/>
    <action application="lua" data="main/xml_handlers/pin/validate_pin.lua"/>
    <action application="bridge" data="..."/>
  </condition>
</extension>

Scenario 2: Department Cost Centers

Multiple Lists:
List NamePurpose
Sales PINsSales team calls
Support PINsSupport team calls
Executive PINsExecutive calls
Tracking: Each PIN usage can be logged with the PIN description for billing.

Scenario 3: Temporary Guest Access

Setup:
PINDescriptionEnabled
8888Conference Room A
9999Guest Access
Usage: Disable guest PIN after event ends.

---

8. Limitations & Important Notes

Technical Limitations

WARNING
PIN Uniqueness: PINs must be unique within a single list.
WARNING
Case Sensitivity: PINs are case-sensitive if using letters.

Best Practices

  1. Unique PINs Per User: For accountability
  2. Descriptive Names: "John Smith" not "PIN 1"
  3. Regular Audits: Review PIN lists quarterly
  4. Disable vs. Delete: Use disable for temporary revocation
  5. Strong PINs: Avoid 1234, 0000, 1111

Security Considerations

CAUTION
Shared PINs: Avoid sharing PINs between users—no accountability.

---

9. Troubleshooting Tips

Common Issues

SymptomPossible CauseSolution
"Feature not available"List not found/disabledCheck list name and enabled status
"Invalid PIN"PIN not found/disabledVerify PIN exists and is enabled
No prompt heardAudio file missingCheck enter_pin.wav exists
Always failsWrong list nameVerify dialplan pin_list variable

Diagnostic SQL

List all PIN lists:

Sql
SELECT id, name, enabled,
       (SELECT COUNT(*) FROM public.pin_list_members 
        WHERE pin_list_id = l.id) as pin_count
FROM public.pin_lists l
WHERE domain_id = [domain_id];

Check specific PIN:

Sql
SELECT l.name as list_name, m.pin, m.description, m.enabled
FROM public.pin_list_members m
JOIN public.pin_lists l ON m.pin_list_id = l.id
WHERE l.domain_id = [domain_id] AND m.pin = '1234';

---

10. Glossary

TermDefinition
PIN ListA named collection of authorization codes
PIN MemberAn individual PIN within a list
Authorization CodeSame as PIN—code entered for access
pin_list_validChannel variable set after validation
Multi-tenantEach domain has separate PIN lists
CSV ImportBulk upload of PINs from spreadsheet
---

Lua Script Status

✅ Implementation Verified

The Lua handler at telephony/freeswitch/lua/main/xml_handlers/pin/validate_pin.lua is correctly implemented:

CheckStatus
Uses public. schema✅ Correct
SQL injection protection✅ Uses escape()
Multi-tenant support✅ Resolves domain_id
Error handling✅ Proper logging
Audio prompts✅ Uses langutil
No fixes required.

---

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?