CDR Summary

From VoIPmonitor.org
Revision as of 20:00, 2 January 2026 by Admin (talk | contribs) (Create CDR Summary feature documentation)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


The CDR Summary feature provides pre-aggregated call data for significantly faster dashboard and reporting queries. Instead of querying millions of individual CDR records, the GUI can use the summary table which contains data aggregated in 5-minute intervals.

Overview

When enabled, the sniffer creates a cdr_summary table and continuously aggregates CDR data. This dramatically improves performance for large-scale deployments when viewing charts, dashboards, or grouped reports.

Aggregation Dimensions

Data is aggregated by combinations of the following fields:

  • sipcallerip - Source IP address
  • sipcalledip - Destination IP address
  • payload - Codec/payload type
  • last_sip_response - Final SIP response code

Aggregation Interval

The default aggregation interval is 5 minutes. This can be adjusted using the cdr_summary_interval parameter in voipmonitor.conf.

Sniffer Configuration

To enable CDR Summary, add the following to your /etc/voipmonitor.conf:

# Enable CDR summary table
cdr_summary = yes

# Optional: Change aggregation interval (default: 5 minutes)
cdr_summary_interval = 5

After enabling, restart the sniffer. The cdr_summary table will be created automatically and data will begin aggregating.

GUI Behavior

Grouping Options

When the cdr_summary table exists and contains data, the GUI automatically enhances the CDR grouping options:

  • New grouping options appear with the suffix (summary)
  • These summary-based options are displayed above the standard grouping options
  • By default, when entering the CDR panel, the GUI selects a summary-based grouping type (if the summary table is populated)

Filter Behavior

The GUI intelligently switches between summary and standard CDR queries based on the selected filters:

  • Summary-compatible filters: If you filter by fields that exist in the summary table (sipcallerip, sipcalledip, payload, last_sip_response), the summary-based grouping remains active
  • Non-summary filters: If you apply a filter using fields not present in the summary table, the GUI automatically switches to standard CDR-based grouping

This ensures accurate results while maximizing performance when possible.

Database Structure

Value Columns

The summary table contains pre-calculated aggregate values for each 5-minute period. These include counts, averages, and various quality metrics.

Count Columns (_count)

Columns ending with _count store the number of CDR records that contributed to each aggregated value. This is essential for calculating correct weighted averages when querying across multiple time intervals.

For example, if you query a 1-hour range, the GUI uses the _count values to properly weight the averages from each 5-minute bucket.

Histogram Columns (_source_data)

Columns ending with _source_data contain histogram data (value distribution maps) needed for accurate percentile calculations across longer time ranges.

Without these histograms, percentile values (p50, p90, p95, etc.) calculated from pre-aggregated data would be approximations. The histogram data enables exact percentile computation regardless of the query time range.

Percentile Calculation Setting

The use of _source_data columns for percentile calculation is controlled by a PHP define:

// This is now ENABLED by default
// To disable (for performance reasons), add to your configuration.php:
define('CDR_SUMMARY_PERCENTILES_VIA_VALUE_MAP', false);

Note: Disabling this feature will result in approximate percentile values when querying time ranges longer than the aggregation interval.

Data Retention

Partitioning

The cdr_summary table uses the same partitioning scheme as the main CDR tables.

Cleanup

By default, cdr_summary data is cleaned up using the same retention settings as CDR data.

To configure a different retention period specifically for summary data, use:

cleandatabase_cdr_summary = 180

This sets the retention to 180 days for summary data, independent of the main CDR retention setting.

Performance Considerations

  • Storage: The summary table is significantly smaller than the full CDR table, typically 100-1000x smaller depending on traffic patterns
  • Query speed: Dashboard and chart queries can be 10-100x faster when using summary data
  • CPU overhead: Minimal additional CPU usage on the sniffer for aggregation
  • Recommended for: Deployments with more than 1 million CDRs or when dashboard performance is critical

AI Summary for RAG

Summary: CDR Summary is a performance optimization feature that pre-aggregates CDR data into 5-minute intervals in a cdr_summary table. Enable it with cdr_summary=yes in voipmonitor.conf. Data is aggregated by sipcallerip, sipcalledip, payload, and last_sip_response. The GUI automatically uses summary data for grouping (shown with "(summary)" suffix) and intelligently switches between summary and full CDR queries based on selected filters. The table includes _count columns for weighted averages and _source_data columns (histograms) for accurate percentile calculations. Percentile histogram usage is now enabled by default (CDR_SUMMARY_PERCENTILES_VIA_VALUE_MAP). Cleanup uses same settings as CDR unless cleandatabase_cdr_summary is specified.

Keywords: cdr_summary, cdr summary, aggregation, performance, dashboard performance, grouping summary, cdr_summary_interval, cleandatabase_cdr_summary, percentile, histogram, _source_data, _count, weighted average, CDR_SUMMARY_PERCENTILES_VIA_VALUE_MAP

Key Questions:

  • How do I enable CDR summary for faster dashboard queries?
  • What is cdr_summary and how does it work?
  • How to improve CDR dashboard performance?
  • What fields are aggregated in cdr_summary?
  • How does GUI grouping work with summary tables?
  • What is the cdr_summary_interval parameter?
  • How are percentiles calculated with cdr_summary?
  • What are the _count and _source_data columns in cdr_summary?
  • How to configure different retention for cdr_summary?
  • What is CDR_SUMMARY_PERCENTILES_VIA_VALUE_MAP?