Dynamic Destinations Module Documentation
Table of Contents
Section titled βTable of Contentsβ- Module Overview (Technical)
- Module Overview (Commercial/Business)
- Module Overview (End User/Administrator)
- 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 Are Dynamic Destinations?
Section titled βWhat Are Dynamic Destinations?βDynamic Destinations allow real-time call routing decisions based on external data sources. The system queries a database or HTTP API, evaluates the response, and routes the call to a matching destination.
Architecture
Section titled βArchitectureβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ Dynamic Destination System ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€β ββ Inbound call arrives ββ β ββ βΌ ββ ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ ββ β Dynamic Destination Lookup β ββ β SELECT * FROM public.dynamic_destinations β ββ β WHERE name = [config_name] AND active = TRUE β ββ ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ ββ β ββ βΌ ββ ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ ββ β Query External Source β ββ β β ββ β Source Type: DB β ββ β ββ Connect to: postgresql://crm.example.com/db β ββ β ββ Execute: SELECT status FROM clients β ββ β WHERE phone='${caller_id_number}' β ββ β β ββ β Source Type: URL β ββ β ββ Request: https://api.example.com/lookup β ββ β ββ Path: /check?caller=${caller_id_number} β ββ β β ββ ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ ββ β ββ βΌ Response: "VIP" ββ ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ ββ β Match Against Options β ββ β β ββ β Option 1: VIP β Queue: vip_support β MATCH β ββ β Option 2: STANDARD β Queue: general_support β ββ β Option 3: BLACKLIST β Hangup β ββ β Default: β Queue: general_support β ββ β β ββ ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ ββ β ββ βΌ ββ Route call to: Queue vip_support ββ ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ2. Module Overview (Commercial/Business)
Section titled β2. Module Overview (Commercial/Business)βBusiness Value
Section titled βBusiness ValueβDynamic Destinations enable intelligent, data-driven routing:
| Without Dynamic Destinations | With Dynamic Destinations |
|---|---|
| Static routing rules | Real-time decisions |
| Same treatment for all | VIP vs. standard routing |
| No CRM integration | CRM-aware call handling |
| Manual blacklist updates | Automatic blacklist enforcement |
Use Cases
Section titled βUse Casesβ-
CRM-Based VIP Routing
- Query CRM for customer tier
- VIP customers β Priority queue
-
Credit/Account Status
- Check payment status
- Delinquent β Collections queue
-
Blacklist Enforcement
- Query blocklist database
- Blocked callers β Hangup or message
-
Geographic Routing
- Look up caller location
- Route to nearest branch
-
Business Hours Override
- Query external schedule API
- Dynamic after-hours routing
Feature Highlights
Section titled βFeature Highlightsβ| Feature | Benefit |
|---|---|
| Database Source | Query PostgreSQL/MySQL directly |
| HTTP Source | Integrate with REST APIs |
| Variable Substitution | Use ${caller_id_number}, etc. |
| Multiple Options | Match different values to destinations |
| Default Fallback | Handle unmatched cases |
| Priority Ordering | Process options in order |
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 routing flows that query external sources
- Map response values to PBX destinations
- Configure fallback for unmatched responses
- Support both database and HTTP queries
π― User Roles & Key Capabilities
Section titled βπ― User Roles & Key Capabilitiesβ| Role | Key Capabilities |
|---|---|
| Super Admin | Configures global database integrations, external API credentials, domain isolation, and monitors system-wide dynamic routing logs. |
| Tenant Admin | Creates and maintains domain-specific Dynamic Destinations, configures CRM query templates, and maps lookup values to queues, IVRs, or extensions. |
| Call Center Supervisor | Reviews dynamic routing options and verifies that VIP/high-value callers are routed to appropriate priority queues or departments. |
| Support Specialist / Agent | Benefits from automatic context-driven routing where callers are pre-screened and delivered to the correct skill-based destination. |
Navigation
Section titled βNavigationβ- Navigate to PBX Engine β Applications β Dynamic Destination in the sidebar (or visit
/pbx/applications/dynamic-destination). - The list view shows all configured dynamic routing engines, indicating Name, Source Type (DB/URL), Match Field, Default Destination, active Options count, and Status (Active/Inactive).
- Click the + Add button in the top toolbar to create a new dynamic routing engine.
- Click any existing engine row or edit button to update database connection strings, API URLs, or routing option rules.

Administrator Workflow
Section titled βAdministrator Workflowβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ Creating a Dynamic Destination ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€β ββ Step 1: General Settings ββ ββ Name: "CRM Customer VIP Lookup" ββ ββ Description: "Live customer tier lookup via external CRM" ββ ββ Source Type: HTTP Request (URL) ββ ββ URL: https://crm.company.com/api/v1/customer-lookup ββ ββ Payload / Template: {"caller": "${caller_id_number}"} ββ ββ Match Field: tier ββ ββ Default Destination: Queues β General Support ββ ββ Active: Enabled ββ ββ Step 2: Routing Options Matrix ββ ββ Option 1: "VIP" β Queues β Priority VIP Queue (Enabled) ββ ββ Option 2: "COLLECTIONS" β Extensions β Billing Dept (Enabled)ββ ββ Option 3: "PARTNER" β Ring Groups β Partner Desk (Enabled) ββ ββ Step 3: Save and Route Inbound DIDs ββ ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββQuick Tips
Section titled βQuick Tipsβ[!TIP] Variable Substitution: Use
${caller_id_number},${destination_number},${caller_id_name},${uuid}, or${domain_name}within your SQL queries or JSON payload templates.
[!TIP] Fast Fallback: Always ensure your
Default Destinationpoints to a dependable destination (such as a primary IVR or general queue) in case the external API or database times out.
[!CAUTION] Query Latency: Telephony channels can wait a maximum of 2β3 seconds before callers experience dead air. Ensure external database indices and API endpoints respond in under 500ms.
4. Configuration Fields Reference
Section titled β4. Configuration Fields Referenceβ
General Settings Box
Section titled βGeneral Settings Boxβ| Field | Description | UI Tooltip | Example | Notes |
|---|---|---|---|---|
| Name * | Primary identification label | Friendly name identifying this dynamic destination profile | CRM Customer VIP Lookup |
Required. |
| Description | Contextual administrative notes | Optional description of the routing purpose or external database integration | Customer VIP check via CRM API |
Optional. |
| Source Type * | Backend lookup protocol | Data source protocol queried during call routing | HTTP Request (URL) |
Database (DB) or HTTP Request (URL). Required. |
| Match Field * | Extracted variable name | Field name in database row or JSON response key compared against routing rules | tier, status, account_code |
Required. |
| Database Connection * | PostgreSQL or MySQL connection string | Connection string for database source | postgresql://user:pass@host:5432/crm |
Required when Source Type is Database (DB). |
| SQL Query Template * | SQL query with variable placeholders | Parameterized SQL query executed to retrieve routing attributes | SELECT tier FROM clients WHERE phone = '${caller_id_number}' |
Required when Source Type is Database (DB). |
| URL * | REST endpoint address | HTTP/HTTPS URL of the external lookup service | https://crm.company.com/api/v1/customer-lookup |
Required when Source Type is HTTP Request (URL). |
| Payload / Query Template * | HTTP request body or query template | JSON body or query string template with parameter substitution | {"caller": "${caller_id_number}"} |
Required when Source Type is HTTP Request (URL). |
| Default Destination * | Fallback call destination | Destination to bridge if the query returns no result or fails to match an option | Queues β General Support |
Required. Module and Destination select. |
| Active | Operational status | Master toggle to enable or disable dynamic lookup for inbound calls | Enabled / Disabled |
Toggle. Default: Enabled. |
Routing Options Box
Section titled βRouting Options BoxβThe Routing Options table defines discrete matching rules evaluated against the value extracted from the Match Field.
| Field | Description | UI Tooltip | Example | Notes |
|---|---|---|---|---|
| Match Value * | Expected return value | Exact string or code expected from the external lookup response | VIP, PLATINUM, OVERDUE |
Case-sensitive string matching. |
| Destination * | Target module and entity | PBX destination bridged when the return value matches | Queues β Priority VIP Queue |
Selectable module (Extension, Queue, Ring Group, IVR, etc.). |
| Enabled | Rule state | Toggle to enable or disable this specific match rule | Enabled / Disabled |
Toggle per option row. |
| Actions | Row management | Remove this match option from the routing table | Trash Icon | Removes the row. |
Query Template Variables Reference
Section titled βQuery Template Variables ReferenceβThe dynamic routing engine interpolates runtime channel variables prior to executing the database query or HTTP API call:
| Variable | Description | Runtime Example |
|---|---|---|
${caller_id_number} |
Incoming Caller ID phone number | 15551234567 |
${caller_id_name} |
Inbound Caller ID Name (CNAM) | John Doe |
${destination_number} |
Dialed DID or virtual extension | 18005550199 |
${domain_name} |
PBX telephony tenant domain | pbx.company.com |
${uuid} |
Telephony Server unique channel identifier | e742be94-8bf1-4e78-bc5a-e14b7320a5fd |
5. Call Flow / Logic Explanation
Section titled β5. Call Flow / Logic ExplanationβDynamic Routing Flow
Section titled βDynamic Routing Flowβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ Dynamic Destination Flow ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€β ββ 1. Call arrives, triggers dynamic destination ββ β ββ βΌ ββ 2. Load configuration from database ββ ββ Found & active β Continue ββ ββ Not found β Use default dialplan ββ β ββ βΌ ββ 3. Build query with variable substitution ββ ${caller_id_number} β 5551234567 ββ β ββ βΌ ββ 4. Execute external query ββ ββ Database: Run SQL, get result ββ ββ HTTP: Make request, parse response ββ β ββ βΌ ββ 5. Extract match field from response ββ Response: {"tier": "VIP"} β Match value: "VIP" ββ β ββ βΌ ββ 6. Search options (by priority order) ββ ββ Option "VIP" β MATCH ββ β ββ Route to: Queue vip_support ββ ββ Option "STANDARD" (skipped) ββ ββ Option "BLOCKED" (skipped) ββ β ββ βΌ ββ 7. If no match β Use default destination ββ β ββ βΌ ββ 8. Transfer call to resolved destination ββ ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ6. Common Scenarios & Examples
Section titled β6. Common Scenarios & ExamplesβScenario 1: CRM Customer Tier Routing
Section titled βScenario 1: CRM Customer Tier RoutingβConfiguration:
| Setting | Value |
|---|---|
| Name | CRM Tier Routing |
| Source Type | Database |
| Connection | postgresql://crm:pass@crm.local/customers |
| Query | SELECT tier FROM clients WHERE phone='${caller_id_number}' |
| Match Field | tier |
Options:
| Match | Destination |
|---|---|
| VIP | Queue: vip_support |
| GOLD | Queue: priority_support |
| STANDARD | Queue: general_support |
| Default | Queue: general_support |
Scenario 2: Blacklist Check via API
Section titled βScenario 2: Blacklist Check via APIβConfiguration:
| Setting | Value |
|---|---|
| Name | Blacklist Check |
| Source Type | HTTP Request |
| Base URL | https://blocklist.example.com |
| Endpoint | /check?phone=${caller_id_number} |
| Match Field | blocked |
Options:
| Match | Destination |
|---|---|
| true | Hangup |
| false | Queue: main_queue |
| Default | Queue: main_queue |
Scenario 3: Payment Status Routing
Section titled βScenario 3: Payment Status RoutingβConfiguration:
| Setting | Value |
|---|---|
| Name | Payment Status |
| Source Type | Database |
| Query | SELECT status FROM accounts WHERE phone='${caller_id_number}' |
| Match Field | status |
Options:
| Match | Destination |
|---|---|
| DELINQUENT | Queue: collections |
| SUSPENDED | IVR: payment_options |
| ACTIVE | Queue: customer_service |
| Default | Queue: customer_service |
7. Model Context Protocol (MCP) AI Integration
Section titled β7. Model Context Protocol (MCP) AI IntegrationβRing2All exposes dedicated Model Context Protocol (MCP) tools for Dynamic Destinations, allowing autonomous AI agents and Copilots to inspect real-time CRM/HTTP webhook routing rules, provision automated external lookup engines, and modify data source configurations with domain-level isolation.
Available MCP Tools
Section titled βAvailable MCP Toolsβ| Tool Name | Description | Key Parameters |
|---|---|---|
list_dynamic_destinations |
Lists all dynamic destination engines configured in the domain, including webhook URLs, DB sources, and fallback modules. | search (optional string) |
get_dynamic_destination_status |
Retrieves full routing logic, webhook parsing rules, source queries, and configured match branch options for a dynamic destination. | name (required) |
create_dynamic_destination |
Creates a new external-lookup routing destination using an HTTP REST endpoint or SQL query, with fallback routing. | name, sourceType (βURLβ or βDBβ), sourceConfig, defaultModule, defaultDestination, matchField |
update_dynamic_destination |
Updates external source URL/query, JSON match field parsing, or fallback route destinations. | name, newName, sourceType, sourceConfig, defaultModule, defaultDestination, enabled |
delete_dynamic_destination |
Deletes a dynamic destination configuration from the domain. | name (required) |
AI Agent Operational Examples
Section titled βAI Agent Operational ExamplesβQuerying Dynamic Destination Lookup Engines
Section titled βQuerying Dynamic Destination Lookup Enginesβ{ "tool": "list_dynamic_destinations", "arguments": { "search": "CRM" }}Provisioning an AI-Driven VIP Routing Lookup
Section titled βProvisioning an AI-Driven VIP Routing Lookupβ{ "tool": "create_dynamic_destination", "arguments": { "name": "HubSpot VIP Tier Routing", "sourceType": "URL", "sourceConfig": "https://api.crm.example.com/v1/lookup?caller=${caller_id_number}", "matchField": "customer_tier", "defaultModule": "queue", "defaultDestination": "support_standard" }}Recommended Natural Language Prompts
Section titled βRecommended Natural Language Promptsβ- βShow me all dynamic destinations that route incoming calls based on external CRM webhooks.β
- βCreate a dynamic destination called βZendesk VIP Checkβ that queries https://crm.internal/api/tier and falls back to IVR 100.β
- βInspect the matching rules for βHubSpot VIP Tier Routingβ.β
8. Limitations & Important Notes
Section titled β8. Limitations & Important NotesβTechnical Limitations
Section titled βTechnical Limitationsβ[!WARNING] Query Latency: External queries add delay. Keep queries fast (<500ms).
[!WARNING] Connection Failures: If external source is down, default destination is used.
[!IMPORTANT] Security: Connection strings are stored in database. Use secure connections.
Best Practices
Section titled βBest Practicesβ- Fast Queries: Index lookup columns
- Timeout Handling: External sources may fail
- Default Always: Configure fallback for all cases
- Test Thoroughly: Verify all match values route correctly
- Monitor Latency: Track query performance
Security Considerations
Section titled βSecurity Considerationsβ[!CAUTION] SQL Injection: Variables are substituted directlyβensure trusted sources.
9. Troubleshooting Tips
Section titled β9. Troubleshooting TipsβCommon Issues
Section titled βCommon Issuesβ| Symptom | Possible Cause | Solution |
|---|---|---|
| Always uses default | Query returns no match | Check query and match field |
| βFeature not availableβ | Config not found/disabled | Verify active status |
| Long call setup | Slow external query | Optimize query, add indexes |
| Wrong destination | Match value mismatch | Check case sensitivity |
Diagnostic SQL
Section titled βDiagnostic SQLβList dynamic destinations:
SELECT name, source_type, match_field, active, (SELECT COUNT(*) FROM public.dynamic_destination_options WHERE dynamic_destination_id = d.id) as option_countFROM public.dynamic_destinations dWHERE domain_id = [domain_id];Check options:
SELECT match_value, destination_module, destination, priority, enabledFROM public.dynamic_destination_optionsWHERE dynamic_destination_id = [dd_id]ORDER BY priority;10. Glossary
Section titled β10. Glossaryβ| Term | Definition |
|---|---|
| Dynamic Destination | Routing configuration that queries external sources |
| Source Type | Database (DB) or HTTP Request (URL) |
| Query Template | SQL or HTTP path with variable placeholders |
| Match Field | Response key containing value to match |
| Routing Option | Match value mapped to a destination |
| Default Destination | Fallback when no option matches |
| Variable Substitution | Replacing ${var} with call data |
| Priority | Order in which options are evaluated |
Documentation last updated: January 2026

