Direct Route Module Documentation
Table of Contents
Section titled βTable of Contentsβ- Module Overview (Technical)
- Module Overview (Commercial/Business)
- Module Overview (End User/Administrator)
- User Roles & Key Capabilities
- Configuration Fields Reference
- Call Flow / Logic Explanation
- Common Scenarios & Examples
- Model Context Protocol (MCP) AI Integration
- Limitations & Important Notes
- Troubleshooting Tips
- Glossary
1. Module Overview (Technical)
Section titled β1. Module Overview (Technical)βWhat Is Direct Route?
Section titled βWhat Is Direct Route?βDirect Route is a Class of Service bypass mechanism that allows specific phone numbers to be dialed by users who would otherwise be restricted. It provides exception-based routing with optional caller ID override.
The Problem It Solves
Section titled βThe Problem It SolvesβNormal Flow:User (CoS: Local Only) β Dial +44-123-456-7890 β β BLOCKED (International)
With Direct Route:User (CoS: Local Only) β Dial +44-123-456-7890 β β
ALLOWED (Direct Route exists)Architecture
Section titled βArchitectureβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ Direct Route System ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€β ββ User dials: +44-123-456-7890 ββ β ββ βΌ ββ ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ ββ β Direct Route Lookup β ββ β SELECT * FROM direct_routes β ββ β WHERE number_to_dial = '+44-123-456-7890' β ββ β AND class_of_services_id = [user_cos_id] β ββ β AND enabled = true β ββ ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ ββ β ββ ββ Found β Bypass CoS check, apply caller ID override ββ ββ Not Found β Normal dialrule processing (may block) ββ β ββ βΌ ββ ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ ββ β Route Call β ββ β ββ Apply caller ID override (if configured) β ββ β ββ Bridge call to destination via trunk β ββ ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ ββ ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ2. Module Overview (Commercial/Business)
Section titled β2. Module Overview (Commercial/Business)βBusiness Value
Section titled βBusiness ValueβDirect Route provides granular exception control without modifying Class of Service:
| Without Direct Route | With Direct Route |
|---|---|
| Create separate CoS for exception users | Keep standard CoS, add exceptions |
| All-or-nothing permission models | Specific number-level control |
| Security risk with broad permissions | Minimal permission expansion |
Use Cases
Section titled βUse Casesβ-
Partner/Vendor Access
- International call restriction is on
- Need to call specific overseas vendor
- Create Direct Route for that specific number
-
Emergency Contacts
- Allow specific numbers regardless of CoS
- Corporate emergency line, CEO mobile, etc.
-
Customer Service Numbers
- Toll-free customer support numbers
- Specific client hotlines
-
Caller ID Override
- Appear as different number when calling specific destinations
- Compliance or privacy requirements
Feature Highlights
Section titled βFeature Highlightsβ- CoS-Based Control: Each route is tied to a Class of Service
- Caller ID Override: Override outbound caller ID per destination
- Enable/Disable: Quickly toggle without deletion
- Specific Number: Exact match on destination number
3. Module Overview (End User/Administrator)
Section titled β3. Module Overview (End User/Administrator)βWhat Can You Do?
Section titled βWhat Can You Do?β- Create routes that bypass CoS restrictions for specific numbers
- Override caller ID when calling specific destinations
- Tie routes to specific Class of Service groups
- Enable/disable routes without deletion
Navigation
Section titled βNavigationβ- Navigate to PBX β Applications β Direct Route in the main sidebar.
- The list view displays all configured direct route exceptions, detailing their Route Name, Number to Dial, assigned Class of Service, Description, and Enabled status.
- Click the + Add button in the upper toolbar to configure a new direct route exception.
- Click any row or the edit icon to modify routing parameters, update the authorized Class of Service, or change Caller ID overrides.

User Workflow
Section titled βUser Workflowβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ Creating a Direct Route ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€β ββ Scenario: Sales team (Local-Only CoS) needs to call ββ UK vendor at +44-20-7946-0958 ββ ββ 1. Basic Information ββ ββ Name: "UK Vendor - ABC Corp" ββ ββ Description: "Exception for Sales team" ββ ββ 2. Routing Configuration ββ ββ Number To Dial: +44-20-7946-0958 ββ ββ Class of Service: "Local Only" (Sales team's CoS) ββ ββ 3. Caller ID Override (Optional) ββ ββ Caller ID Name: "ABC Sales" ββ ββ Caller ID Number: +1-555-123-4567 ββ ββ 4. Enable: Yes ββ ββ 5. Save β Sales can now dial +44-20-7946-0958 ββ ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββQuick Tips
Section titled βQuick Tipsβ[!TIP] Use Full Number Format: Include country code and complete prefix for international numbers (e.g.,
+44-20-7946-0958).
[!TIP] Document Purpose: Use a clear, identifiable name so administrators know why the exception was granted.
[!CAUTION] CoS Must Match: The route exception only applies to users whose extension is assigned to the specified Class of Service.
π― User Roles & Key Capabilities
Section titled βπ― User Roles & Key Capabilitiesβ| Role | Key Capabilities | Best Practice / Limitations |
|---|---|---|
| Super Admin | Full cross-tenant configuration of direct routes, OCS pre-routing rating enforcement, and trunk assignment. | Ensure direct routes have unique dial numbers per domain to prevent dialplan collisions. |
| PBX Administrator | Create, edit, and disable direct route bypass exceptions for assigned Class of Service profiles; set custom outbound Caller ID. | Audit bypass numbers periodically and remove obsolete exceptions to maintain toll restriction integrity. |
| Branch Manager | View existing direct route bypasses; request new exceptions for specific vendor or partner numbers. | Coordinate with PBX admins to identify required Class of Service groups before provisioning. |
| Agent / Extension User | Transparently dial authorized direct route numbers without encountering Class of Service restrictions or block messages. | Destination must match dialed digit format exactly (e.g., standard E.164 with international prefix). |
4. Configuration Fields Reference
Section titled β4. Configuration Fields Referenceβ
Basic Information Section
Section titled βBasic Information Sectionβ| Field | Technical Description | User-Friendly Tooltip | Example | Required | Notes |
|---|---|---|---|---|---|
| Name * | Unique identifier for this direct route exception | Descriptive name identifying who or why this direct route exists | National Priority Route, UK Vendor Access |
Yes | The system auto-derives context and description from this name. |
| Caller ID Name | Custom outbound Caller ID display name | Optional custom caller ID name displayed to the recipient when dialing this destination | Ring2All PBX, VIP Support |
No | Overrides default tenant or extension caller ID name. |
| Caller ID Number | Custom outbound Caller ID telephone number | Optional custom phone number shown to the recipient | +15551234567 |
No | Overrides default tenant or extension caller ID number. E.164 format recommended. |
| Number To Dial * | Exact external phone number to route | The telephone number to dial (e.g. +44-20-7946-0958 or 9110) | 9110, +44-20-7946-0958 |
Yes | Must match the dialed number format. |
| Class of Service * | Class of Service group authorized for this route | Select the Class of Service profile that is allowed to bypass restrictions using this route | Default, Local Only |
Yes | Dropdown list populated from configured Classes of Service. |
| Enabled | Master activation toggle | Enable or disable this route without deleting it | Yes / No (toggle) |
Yes | Default: Yes. Inactive routes revert to standard outbound routing. |
5. Call Flow / Logic Explanation
Section titled β5. Call Flow / Logic ExplanationβDirect Route Checking Flow
Section titled βDirect Route Checking Flowβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ Direct Route Check Flow ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€β ββ 1. User (CoS: Local Only) dials +44-20-7946-0958 ββ β ββ βΌ ββ 2. Dialplan checks direct_routes table: ββ SELECT * FROM direct_routes ββ WHERE number_to_dial = '+44-20-7946-0958' ββ AND class_of_services_id = [user_cos_id] ββ AND enabled = true ββ β ββ ββ FOUND β Step 3a ββ ββ NOT FOUND β Step 3b ββ β ββ βΌ (3a - Route exists) ββ 3a. Bypass Class of Service check ββ ββ Apply caller ID override (if configured) ββ β session.setVariable("effective_caller_id_name", "...") ββ β session.setVariable("effective_caller_id_number", "...") ββ ββ Route call to trunk ββ β ββ βΌ ββ Call proceeds to +44-20-7946-0958 ββ ββ βΌ (3b - Route not found) ββ 3b. Normal dialrule processing ββ ββ Check CoS allows international β NO ββ ββ "The number you dialed is not allowed" β hangup ββ ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ6. Common Scenarios & Examples
Section titled β6. Common Scenarios & ExamplesβScenario 1: International Vendor Exception
Section titled βScenario 1: International Vendor ExceptionβProblem: Sales team has βLocal Onlyβ CoS but needs to call UK vendor.
| Field | Value |
|---|---|
| Name | UK Vendor - ABC Corp |
| Number To Dial | +44-20-7946-0958 |
| Class of Service | Local Only |
| Caller ID Override | (none) |
| Enabled | β |
Result: Only users with βLocal Onlyβ CoS can dial this specific UK number.
Scenario 2: Corporate Emergency Line
Section titled βScenario 2: Corporate Emergency LineβProblem: Everyone should be able to reach corporate security regardless of CoS.
| Field | Value |
|---|---|
| Name | Corporate Emergency |
| Number To Dial | +1-800-555-HELP |
| Class of Service | Internal Only |
| Caller ID Override | (none) |
| Enabled | β |
Repeat for each CoS that needs this exception.
Scenario 3: Caller ID Privacy
Section titled βScenario 3: Caller ID PrivacyβProblem: When calling a specific client, show company main line instead of extension.
| Field | Value |
|---|---|
| Name | Client XYZ - Privacy Override |
| Number To Dial | +1-555-987-6543 |
| Class of Service | Standard |
| Caller ID Name | ABC Company |
| Caller ID Number | +1-800-555-0100 |
| Enabled | β |
Result: When calling +1-555-987-6543, recipient sees βABC Companyβ / +1-800-555-0100.
Scenario 4: Multiple CoS Same Number
Section titled βScenario 4: Multiple CoS Same NumberβProblem: Both βSalesβ and βSupportβ CoS need to call the same number.
Solution: Create TWO Direct Routes:
| Route 1 | Route 2 |
|---|---|
| Name: Vendor - Sales | Name: Vendor - Support |
| Number: +44-20-7946-0958 | Number: +44-20-7946-0958 |
| CoS: Sales | CoS: Support |
7. Model Context Protocol (MCP) AI Integration
Section titled β7. Model Context Protocol (MCP) AI IntegrationβDirect Route exceptions can be programmatically audited, created, and managed via the Model Context Protocol (MCP). AI copilots can analyze toll-restriction exception requests and safely create bypass rules without compromising security boundaries or colliding with dialplan resources.
Available MCP Tools
Section titled βAvailable MCP Toolsβ| Tool Name | Operation | Description | Access Level |
|---|---|---|---|
list_direct_routes |
Query | List all direct bypass routes, assigned Class of Service, and destination numbers. | Read-Only |
get_direct_route_status |
Query | Retrieve detailed rule configuration for a specific route name or dialed number. | Read-Only |
create_direct_route |
Provisioning | Create a new CoS exception route for a specific dialed number with optional Caller ID masking. | Admin / Superadmin |
update_direct_route |
Management | Modify target number, CoS association, or Caller ID values for an existing direct route. | Admin / Superadmin |
delete_direct_route |
Deprovisioning | Remove a direct route exception from the PBX. | Superadmin |
Tool Definitions & Parameter Reference
Section titled βTool Definitions & Parameter Referenceβcreate_direct_route
Section titled βcreate_direct_routeβCreates a Class of Service bypass rule for a specific dial string.
{ "name": "create_direct_route", "description": "Create a new Direct Route to bypass Class of Service restrictions for a specific external phone number.", "inputSchema": { "type": "object", "properties": { "name": { "type": "string", "description": "Friendly name (e.g. 'UK Support Center Exception')." }, "numberToDial": { "type": "string", "description": "Exact destination phone number (e.g. '+442079460958' or '18005550199')." }, "classOfServicesId": { "type": "number", "description": "Class of Service ID allowed to use this bypass." }, "callerIdName": { "type": "string", "description": "Optional Caller ID Name override for this destination." }, "callerIdNumber": { "type": "string", "description": "Optional Caller ID Number override for this destination." }, "description": { "type": "string", "description": "Optional notes or business reason for the exception." } }, "required": ["name", "numberToDial"] }}Safety Safeguards & Number Uniqueness
Section titled βSafety Safeguards & Number Uniquenessβ- Domain Number Collision Prevention: The backend verifies
validateNumberUniqueness(numberToDial, domainId, 'direct_routes')againstpublic.dialplan_registryand active routes. If the number conflicts with an internal extension or system resource in the domain, the tool returns a clear conflict error. - Class of Service Verification: If
classOfServicesIdis not explicitly provided, the system defaults to the lowest-privilege standard profile or resolves it by domain context to prevent unauthorized privilege escalation.
Example AI Assistant Prompts & Workflow
Section titled βExample AI Assistant Prompts & WorkflowβExample 1: Creating an International Vendor Bypass
Section titled βExample 1: Creating an International Vendor BypassβAdmin Prompt:
βCreate a direct route allowing calls to London Headquarters at +442079460123 for users with Class of Service ID 3.β
AI Tool Execution:
{ "tool": "create_direct_route", "arguments": { "name": "London HQ Bypass", "numberToDial": "+442079460123", "classOfServicesId": 3, "description": "Exempt London HQ from international call restrictions" }}MCP Response:
{ "success": true, "data": { "message": "Direct Route 'London HQ Bypass' to dial '+442079460123' created successfully!", "name": "London HQ Bypass", "numberToDial": "+442079460123", "callerIdName": "Default", "callerIdNumber": "Default", "id": 8 }}8. Limitations & Important Notes
Section titled β8. Limitations & Important NotesβTechnical Limitations
Section titled βTechnical Limitationsβ[!WARNING] Exact Match Only: The number must match exactly. Wildcards are not supported.
[!WARNING] CoS Specific: Each route is tied to ONE Class of Service. Create multiple routes for multiple CoS groups.
[!IMPORTANT] No Trunk Selection: Direct Route bypasses CoS check but still uses default trunk selection logic.
Best Practices
Section titled βBest Practicesβ- Document Everything: Always explain why the exception exists in the description
- Review Regularly: Audit direct routes quarterlyβremove obsolete ones
- Limit Usage: Direct routes are exceptions, not primary routing
- Use Full Numbers: Include country codes to avoid ambiguity
Security Considerations
Section titled βSecurity Considerationsβ[!CAUTION] Audit Trail: Document who requested each exception and why. Direct routes bypass security controls.
[!CAUTION] Caller ID Fraud: Caller ID override can be misused. Restrict who can create routes.
9. Troubleshooting Tips
Section titled β9. Troubleshooting TipsβCommon Issues
Section titled βCommon Issuesβ| Symptom | Possible Cause | Solution |
|---|---|---|
| Call still blocked | CoS mismatch | Verify userβs CoS matches routeβs CoS |
| Call blocked | Number format mismatch | Check exact number format (with/without +) |
| Caller ID not changing | Trunk overrides | Check trunk doesnβt force caller ID |
| Route not found | Disabled | Verify route is enabled |
Diagnostic SQL
Section titled βDiagnostic SQLβList all direct routes:
SELECT dr.name, dr.number_to_dial, cs.name as cos_name, dr.enabledFROM public.direct_routes drJOIN public.class_of_services cs ON dr.class_of_services_id = cs.idWHERE dr.domain_id = [domain_id]ORDER BY dr.name;Check if route exists for a number:
SELECT dr.name, cs.name as cos_name, dr.enabledFROM public.direct_routes drJOIN public.class_of_services cs ON dr.class_of_services_id = cs.idWHERE dr.number_to_dial = '+44-20-7946-0958' AND dr.domain_id = [domain_id];Find disabled routes:
SELECT name, number_to_dialFROM public.direct_routesWHERE enabled = false AND domain_id = [domain_id];10. Glossary
Section titled β10. Glossaryβ| Term | Definition |
|---|---|
| Direct Route | A bypass rule that allows specific numbers regardless of CoS restrictions |
| Class of Service (CoS) | Permission level defining what types of calls a user can make |
| Dialrule | Pattern matching rules that determine call routing |
| Caller ID Override | Changing the outbound caller ID for a specific destination |
| CNAM | Caller Name - the name portion of caller ID |
| CNUM | Caller Number - the number portion of caller ID |
| Exception | A special case that bypasses normal rules |
| Trunk | Connection to external telephone network (PSTN, SIP provider) |
Documentation last updated: January 2026

