Ctrl K
ring2all.com

Call Detail Records (CDR) Module Documentation

Table of Contents

  1. Module Overview (Technical)
  2. Module Overview (Commercial/Business)
  3. Module Overview (End User/Administrator)
  4. CDR Fields Reference
  5. Filtering Options
  6. Common Scenarios & Examples
  7. Limitations & Important Notes
  8. Troubleshooting Tips
  9. Glossary

---

1. Module Overview (Technical)

What Are Call Detail Records?

Call Detail Records (CDR) is a call logging and reporting system that captures comprehensive information about every call processed by the PBX. It includes caller/destination info, timestamps, duration, quality metrics, and recording access.

Architecture

Plaintext
┌─────────────────────────────────────────────────────────────────┐
│                    CDR System Architecture                      │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│  FreeSWITCH                                                     │
│  ┌──────────────────────────────────────────────────────────┐   │
│  │        Call Processing                                   │   │
│  │                                                          │   │
│  │  Call Start → Processing → Answer → End                  │   │
│  │                                                          │   │
│  └──────────────────────────────────────────────────────────┘   │
│       │                                                         │
│       ▼ mod_cdr_pg (PostgreSQL CDR module)                     │
│  ┌──────────────────────────────────────────────────────────┐   │
│  │        cdr Database                                      │   │
│  │                                                          │   │
│  │  Tables:                                                 │   │
│  │  ├─ public.cdr (call records)                           │   │
│  │  ├─ public.cdr_leg_a (A-leg details)                    │   │
│  │  └─ public.cdr_leg_b (B-leg details)                    │   │
│  │                                                          │   │
│  └──────────────────────────────────────────────────────────┘   │
│       │                                                         │
│       ▼ Backend API                                             │
│  ┌──────────────────────────────────────────────────────────┐   │
│  │        CdrRecordsPage.tsx                                │   │
│  │                                                          │   │
│  │  ┌─────────────────────────────────────────────────────┐ │   │
│  │  │ Filters:                                            │ │   │
│  │  │ [Date Range] [Call Type] [Caller] [Destination]     │ │   │
│  │  └─────────────────────────────────────────────────────┘ │   │
│  │                                                          │   │
│  │  ┌─────────────────────────────────────────────────────┐ │   │
│  │  │ Caller   │ Dest    │ Duration │ Status │ Recording │ │   │
│  │  ├──────────┼─────────┼──────────┼────────┼───────────┤ │   │
│  │  │ 1001     │ +1555.. │ 0:05:23  │ ✓      │ ▶️ 📥     │ │   │
│  │  └─────────────────────────────────────────────────────┘ │   │
│  │                                                          │   │
│  └──────────────────────────────────────────────────────────┘   │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

Key Tables

TablePurpose
public.cdrMain call detail records
public.cdr_leg_aA-leg (originator) details
public.cdr_leg_bB-leg (destination) details

Key Files

FileDescription
modules/callDetailRecords/CdrRecordsPage.tsxMain CDR page
modules/callDetailRecords/components/UI components
modules/callDetailRecords/hooks/Data hooks
---

2. Module Overview (Commercial/Business)

Business Value

CDR provides complete call visibility:

Without CDRWith CDR
No call historyFull audit trail
Unknown call qualityQoS metrics
Manual billingAutomatic logging
No recordingsIntegrated playback

Use Cases

  1. Billing & Accounting
- Track billable seconds

- Account code reporting

  1. Troubleshooting
- Identify failed calls

- Analyze call quality

  1. Compliance
- Call recording access

- Audit trail

  1. Analytics
- Call volume trends

- Peak hour analysis

Feature Highlights

FeatureBenefit
Date FiltersHistorical queries
Call Type FilterIn/Out/Internal
SearchFind specific calls
QoS MetricsMOS, jitter, packet loss
Recording AccessPlay/download recordings
ExportGenerate reports
---

3. Module Overview (End User/Administrator)

What Can You Do?

  • View all call records
  • Filter by date range
  • Filter by call type
  • Search by caller/destination
  • Play call recordings
  • Download recordings
  • Analyze call quality

CDR Interface

Plaintext
┌─────────────────────────────────────────────────────────────────┐
│              Call Detail Records                                │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│  Filters:                                                       │
│  ├─ Range: [Today ▼] [01/16/2026] to [01/16/2026]              │
│  ├─ Call Type: [All ▼]                                         │
│  ├─ Caller: [                  ]                               │
│  ├─ Destination: [             ]                               │
│  └─ [Apply Filters] [Refresh] [Clear]                          │
│                                                                 │
│  🔍 [Search by caller, destination, or domain...    ]          │
│                                                                 │
│  ┌───────────────────────────────────────────────────────────┐  │
│  │ Time     │ Caller   │ Dest      │ Dir  │ Dur  │ Status │🎵│  │
│  ├──────────┼──────────┼───────────┼──────┼──────┼────────┼──┤  │
│  │ 10:30:45 │ 1001     │+1555123.. │ OUT  │ 5:23 │ ✓      │▶️│  │
│  │ 10:28:12 │+1555456..│ 1002     │ IN   │ 2:45 │ ✓      │▶️│  │
│  │ 10:25:00 │ 1003     │ 1004     │ INT  │ 0:30 │ ✓      │  │  │
│  │ 10:20:15 │ 1001     │+1555789..│ OUT  │ 0:00 │ ✗      │  │  │
│  └───────────────────────────────────────────────────────────┘  │
│                                                                 │
│  Showing 1-25 of 1,234 records                                  │
│  [< Previous] [Next >]                                          │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

Quick Tips

TIP
Quick Date Ranges: Use dropdown for Today, 7 Days, 15 Days, 30 Days.
TIP
Recording Playback: Click the play icon to hear call recordings.
CAUTION
Large Date Ranges: Limit to 30 days for performance.

---

4. CDR Fields Reference

Call Information

FieldDescription
UUIDUnique call identifier
Caller NameCaller ID name
Caller NumberCaller phone/extension
DestinationCalled number
DirectionInbound/Outbound/Internal
ContextFreeSWITCH context

Timestamps

FieldDescription
Start TimeCall initiated
Answer TimeCall answered
End TimeCall ended
DurationTotal duration (seconds)
Billable SecondsAnswered duration

Technical Details

FieldDescription
Hangup CauseCall termination reason
SIP DispositionSIP status
Gateway/TrunkGateway used
Account CodeBilling code
Authorization CodeAuth code used
Read/Write CodecAudio codecs

Quality Metrics

FieldDescription
MOS ScoreMean Opinion Score (1-5)
Packet Loss (%)Audio packet loss
Jitter (ms)Audio jitter
Max Delay (ms)Maximum delay
PDD (ms)Post-dial delay

Recording

FieldDescription
Recording FilePath to recording
PlayIn-browser playback
DownloadDownload recording
---

5. Filtering Options

Date Range

OptionDescription
TodayCurrent day
7 DaysLast week
15 DaysLast 2 weeks
30 DaysLast month
CustomSelect dates

Call Type

TypeDescription
AllAll calls
InboundIncoming calls
OutboundOutgoing calls
InternalExtension to extension
TransitPass-through

Search Fields

FieldDescription
CallerPartial match on caller
DestinationPartial match on destination
Saved FiltersApply CDR Filter templates
---

6. Common Scenarios & Examples

Scenario 1: View Today's Calls

  1. Select Today from range dropdown
  2. Click Apply Filters
  3. Browse results

Scenario 2: Find Failed Outbound

  1. Set Call Type to Outbound
  2. Look for calls with duration = 0
  3. Check hangup cause

Scenario 3: Listen to Recording

  1. Find call in list
  2. Click ▶️ play icon
  3. Recording plays in browser

Scenario 4: Analyze Call Quality

  1. View MOS Score column
  2. Check Packet Loss %
  3. Review Jitter values

Scenario 5: Export for Billing

  1. Set date range
  2. Apply filters
  3. Export to CSV

---

7. Limitations & Important Notes

Technical Notes

NOTE
Real-time: CDR records appear after call ends.
NOTE
Recording Depends: Recording must be enabled for call.
WARNING
Performance: Large date ranges may be slow.

Data Retention

SettingDescription
CDR RetentionConfigured per system
Recording RetentionSeparate storage policy

Best Practices

  1. Limit Date Range: Use shortest needed range
  2. Use Filters: Narrow results before searching
  3. Save Filters: Create CDR Filters for common queries
  4. Regular Export: Archive important records
  5. Monitor Quality: Review MOS scores regularly

---

8. Troubleshooting Tips

Common Issues

SymptomPossible CauseSolution
No recordsWrong date rangeAdjust dates
Missing callsFilter too restrictiveClear filters
Recording won't playFile deletedCheck retention
Slow loadingLarge date rangeReduce range
Quality metrics N/ACodec issueCheck RTP settings

Diagnostic SQL

Recent CDR records:

Sql
SELECT 
  start_stamp,
  caller_id_number,
  destination_number,
  direction,
  duration,
  billsec,
  hangup_cause
FROM public.cdr
WHERE domain_id = [domain_id]
ORDER BY start_stamp DESC
LIMIT 20;

Call quality summary:

Sql
SELECT 
  AVG(rtp_audio_in_mos) as avg_mos,
  AVG(rtp_audio_in_packet_loss_percent) as avg_loss,
  AVG(rtp_audio_in_jitter_mean) as avg_jitter
FROM public.cdr
WHERE domain_id = [domain_id]
  AND start_stamp >= NOW() - INTERVAL '24 hours';

---

9. Glossary

TermDefinition
CDRCall Detail Record
MOSMean Opinion Score (quality 1-5)
JitterVariation in packet arrival time
PDDPost-Dial Delay
BillsecBillable seconds (answered time)
Hangup CauseReason call ended
A-LegOriginating party
B-LegDestination party
---

Lua Script Status ℹ️

No Lua Handler Required

ComponentStatus
Call Detail Recordsℹ️ Frontend reporting module - reads from CDR database
CDR is populated automatically by FreeSWITCH's mod_cdr_pg module. The frontend queries the CDR database via the backend API. No custom Lua handlers are used.

---

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?