Ctrl K
ring2all.com

Caller ID Lookup Sources 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. Source Types
  6. Common Scenarios & Examples
  7. Limitations & Important Notes
  8. Troubleshooting Tips
  9. Glossary

---

1. Module Overview (Technical)

What Are Caller ID Lookup Sources?

Caller ID Lookup Sources define external data sources used to enrich incoming caller information. When a call arrives, the system queries these sources to look up the caller's name, company, or other details based on their phone number.

Architecture

Plaintext
┌─────────────────────────────────────────────────────────────────┐
│              Caller ID Lookup Flow                              │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│  Incoming Call: +15058881234, WIRELESS CALLER                   │
│       │                                                         │
│       ▼                                                         │
│  ┌──────────────────────────────────────────────────────────┐   │
│  │        Lookup Sources (by priority)                      │   │
│  │                                                          │   │
│  │  Source 1: Internal Directory                            │   │
│  │    Type: internal                                        │   │
│  │    → Query public.contacts                               │   │
│  │    → Match: John Smith, ABC Company                      │   │
│  │                                                          │   │
│  │  Source 2: CRM API (fallback)                           │   │
│  │    Type: http                                            │   │
│  │    → GET https://crm.example.com/api/lookup?phone=...    │   │
│  │    → (skipped - Source 1 matched)                        │   │
│  │                                                          │   │
│  │  Source 3: OpenCNAM (last resort)                        │   │
│  │    Type: opencnam                                        │   │
│  │    → (skipped - Source 1 matched)                        │   │
│  │                                                          │   │
│  └──────────────────────────────────────────────────────────┘   │
│       │                                                         │
│       ▼                                                         │
│  Enriched Call:                                                 │
│  ├─ Caller ID Number: +15058881234                             │
│  └─ Caller ID Name: John Smith - ABC Company                   │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

Key Tables

TablePurpose
public.caller_id_lookup_sourcesLookup source configurations
public.caller_id_lookup_cacheCached results (optional)

Key Files

FileDescription
admin/apps/web/src/modules/callerIdLookupSources/Frontend module
admin/apps/web/src/i18n/en/callerIdLookupSources.jsonTranslations
NOTE

Caller ID lookups are performed during inbound call routing using the configured sources.

---

2. Module Overview (Commercial/Business)

Business Value

Caller ID Lookup Sources enable caller identification:

Without Lookup SourcesWith Lookup Sources
"WIRELESS CALLER"Customer name from CRM
No contextCompany information
Manual lookupAutomatic enrichment
Generic displayPersonalized greeting

Use Cases

  1. CRM Integration
- Look up customer name

- Display account status

  1. Internal Directory
- Match against employee list

- Show department info

  1. OpenCNAM/CNAM
- Public CNAM database

- Unknown caller identification

  1. LDAP Directory
- Enterprise directory lookup

- Active Directory integration

Feature Highlights

FeatureBenefit
Multiple SourcesFallback cascade
Source TypesHTTP, LDAP, Database, OpenCNAM
CachingReduce lookup time
Timeout ControlPrevent call delays
Priority OrderControl lookup sequence
---

3. Module Overview (End User/Administrator)

What Can You Do?

  • Configure lookup sources
  • Choose source types (HTTP, LDAP, Database, etc.)
  • Set authentication credentials
  • Configure timeouts
  • Enable caching
  • Prioritize sources

Administrator Workflow

Plaintext
┌─────────────────────────────────────────────────────────────────┐
│              Creating a Lookup Source                           │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│  Tab: General                                                   │
│  ├─ Name: "CRM Customer Lookup"                                │
│  ├─ Source Type: HTTP API                                      │
│  ├─ URL: https://crm.example.com/api/caller?phone=${caller_id} │
│  ├─ HTTP Method: GET                                           │
│  └─ Enabled: ✓                                                 │
│                                                                 │
│  Tab: Advanced Settings                                         │
│  ├─ Auth Username: api_user                                    │
│  ├─ Auth Password: ********                                    │
│  ├─ API Token: (optional)                                      │
│  ├─ Timeout: 3 seconds                                         │
│  └─ Cache TTL: 3600 seconds                                    │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

Quick Tips

TIP
Cache Results: Enable caching to reduce repeated lookups and speed up call setup.
TIP
Low Timeouts: Keep timeouts under 3 seconds to avoid call delays.
CAUTION
Authentication: Secure your API credentials properly.

---

4. Configuration Fields Reference

General Fields

FieldDescriptionExample
NameSource identifierCRM Lookup
Source TypeType of sourceHTTP API
URL / EndpointConnection stringhttps://api.example.com/lookup
HTTP MethodGET or POSTGET
EnabledSource activeOn/Off

Authentication Fields

FieldDescription
Auth UsernameUsername for auth
Auth PasswordPassword for auth
API TokenToken for OpenCNAM or token-based APIs

Performance Fields

FieldDescriptionRange
TimeoutMax wait time1-30 seconds
Cache TTLCache duration0-3600 seconds
---

5. Source Types

Internal

Look up in local database:

SettingDescription
EndpointNot required
AuthNot required
UsageQuery internal contacts/directory

HTTP API

Call external REST API:

SettingDescription
URLAPI endpoint with phone placeholder
MethodGET or POST
AuthBasic auth or token
ResponseJSON with caller name/info
Expected Response Format:

Json
{
  "cidname": "John Smith",
  "cidnumber": "+15058881234",
  "company": "ABC Company"
}

LDAP

Query LDAP/Active Directory:

SettingDescription
URLldap://ldap.example.com:389
UsernameBind DN
PasswordBind password
UsageSearch user by phone attribute

Database

Query external database:

SettingDescription
URLConnection string (PostgreSQL, MySQL)
UsernameDatabase user
PasswordDatabase password
UsageExecute SQL query

OpenCNAM

Public CNAM lookup service:

SettingDescription
TokenOpenCNAM API key
TimeoutRequest timeout
UsageCNAM database lookup

Custom

Lua script for custom logic:

SettingDescription
ScriptPath to Lua script
UsageCustom lookup logic
---

6. Common Scenarios & Examples

Scenario 1: CRM API Lookup

Source: "CRM Lookup"
SettingValue
TypeHTTP API
URLhttps://crm.example.com/api/caller?phone=[CIDNUM]
MethodGET
Timeout3
Cache TTL3600

Scenario 2: Internal Directory

Source: "Employee Directory"
SettingValue
TypeInternal
Enabled
Queries public.contacts for matching phone numbers.

Scenario 3: OpenCNAM Fallback

Source: "OpenCNAM"
SettingValue
TypeOpenCNAM
Tokenyour-opencnam-api-key
Timeout3
Cache TTL86400

Scenario 4: LDAP/Active Directory

Source: "Corporate Directory"
SettingValue
TypeLDAP
URLldap://ad.company.com:389
UsernameCN=lookup,DC=company,DC=com
Password
Timeout2
---

7. Limitations & Important Notes

Technical Notes

NOTE
Cache Saves Time: Caching reduces lookup latency on repeated calls.
WARNING
Timeout Impact: Long timeouts delay call setup. Keep under 3 seconds.
WARNING
External Dependencies: API outages can affect lookup availability.

Best Practices

  1. Low Timeouts: 2-3 seconds maximum
  2. Enable Caching: Reduce repeated lookups
  3. Priority Order: Put fastest sources first
  4. Fallback Sources: Configure backup sources
  5. Monitor Failures: Track lookup success rates

---

8. Troubleshooting Tips

Common Issues

SymptomPossible CauseSolution
No lookup resultsSource disabledEnable source
Timeout errorsSlow APIReduce timeout, check API
Auth failuresWrong credentialsVerify username/password
Empty nameNo match foundAdd fallback source
Slow callsLong timeoutReduce timeout value

Diagnostic SQL

List lookup sources:

Sql
SELECT id, name, source_type, url, timeout, cache_ttl, enabled
FROM public.caller_id_lookup_sources
WHERE domain_id = [domain_id];

Check cache:

Sql
SELECT phone_number, caller_name, cached_at
FROM public.caller_id_lookup_cache
WHERE domain_id = [domain_id]
ORDER BY cached_at DESC
LIMIT 20;

FreeSWITCH Logs

Bash
# Check CID lookup operations
grep "caller_id" /var/log/freeswitch/freeswitch.log
grep "lookup" /var/log/freeswitch/freeswitch.log

---

9. Glossary

TermDefinition
CNAMCaller Name - name associated with phone number
OpenCNAMPublic CNAM lookup service
LDAPLightweight Directory Access Protocol
Cache TTLTime-to-live for cached results
Lookup SourceExternal system for caller info
Fallback*Backup source if primary fails
---

Lua Script Status ℹ️

Configuration Module

ComponentStatus
Lookup Sourcesℹ️ Configuration stored in public.caller_id_lookup_sources, used during inbound call processing
Caller ID lookups are performed during the inbound routing process using the configured sources. Results may be cached in public.caller_id_lookup_cache.

---

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?