# asternic/asternic-cdr-module architecture

> Architecture diagram of the GitHub repository asternic/asternic-cdr-module, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/asternic/asternic-cdr-module
- Repository: https://github.com/asternic/asternic-cdr-module

## Overview

Asternic CDR is an IssabelPBX/FreePBX module for presenting call-detail reports. An administrator installs it through the PBX module manager; users navigate report views, whose PHP implementation queries CDR data and renders summaries. The sampled code also supports detailed call records, recording playback/download, and PDF output. Report categories are visible in the navigation and report code, but unsampled sections limit tracing every category’s implementation. The graph focuses on relationships evidenced in the excerpts or source index; it does not assume unshown client/server wiring.

Main entry points: [`functions.inc.php`](https://github.com/asternic/asternic-cdr-module/blob/master/functions.inc.php) (Call details), [`page.asternic_cdr.php`](https://github.com/asternic/asternic-cdr-module/blob/master/page.asternic_cdr.php) (CDR reports), [`menu.php`](https://github.com/asternic/asternic-cdr-module/blob/master/menu.php) (Report navigation), [`download.php`](https://github.com/asternic/asternic-cdr-module/blob/master/download.php) (Recording download)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_reporting["CDR reporting"]
  node_navigation["Report navigation<br/>[menu.php]"]
  node_reports["CDR reports"]
  node_record_details["Call details<br/>[functions.inc.php]"]
end

subgraph group_interaction["Browser interaction"]
  node_client["Browser controls<br/>[asternic_cdr.js]"]
end

subgraph group_delivery["Recordings and exports"]
  node_download_handler["Recording download<br/>[download.php]"]
  node_exports["PDF export<br/>[functions.inc.php]"]
end

node_user(("PBX user"))
node_cdrdb[("CDR database")]
node_recordings[("Recording files")]

node_user -->|"selects reports"| node_navigation
node_navigation -->|"routes report tabs"| node_reports
node_reports -->|"queries CDRs"| node_cdrdb
node_user -.->|"requests report"| node_reports
node_record_details -->|"queries records"| node_cdrdb
node_record_details -.->|"references recordings"| node_recordings
node_record_details -->|"includes handler"| node_download_handler
node_download_handler -->|"reads file"| node_recordings
node_record_details -->|"generates PDF"| node_exports

click node_navigation "https://github.com/asternic/asternic-cdr-module/blob/master/menu.php"
click node_reports "https://github.com/asternic/asternic-cdr-module/blob/master/page.asternic_cdr.php"
click node_client "https://github.com/asternic/asternic-cdr-module/blob/master/asternic_cdr.js"
click node_record_details "https://github.com/asternic/asternic-cdr-module/blob/master/functions.inc.php"
click node_download_handler "https://github.com/asternic/asternic-cdr-module/blob/master/download.php"
click node_exports "https://github.com/asternic/asternic-cdr-module/blob/master/functions.inc.php"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_navigation,node_reports,node_record_details,node_user toneBlue
class node_client,node_cdrdb,node_recordings toneAmber
class node_download_handler,node_exports toneMint
```

## Components

### CDR reporting

- [Report navigation](https://github.com/asternic/asternic-cdr-module/blob/master/menu.php): `menu.php`
- [CDR reports](https://github.com/asternic/asternic-cdr-module/blob/master/page.asternic_cdr.php): `page.asternic_cdr.php`
- [Call details](https://github.com/asternic/asternic-cdr-module/blob/master/functions.inc.php): `functions.inc.php`

### Browser interaction

- [Browser controls](https://github.com/asternic/asternic-cdr-module/blob/master/asternic_cdr.js): `asternic_cdr.js`

### Recordings and exports

- [Recording download](https://github.com/asternic/asternic-cdr-module/blob/master/download.php): `download.php`
- [PDF export](https://github.com/asternic/asternic-cdr-module/blob/master/functions.inc.php): `functions.inc.php`

### Other components

- **PBX user**
- **CDR database**
- **Recording files**

## Connections

- PBX user → Report navigation: selects reports (evidence: `menu.php`)
- Report navigation → CDR reports: routes report tabs (evidence: `menu.php`)
- CDR reports → CDR database: queries CDRs (evidence: `page.asternic_cdr.php`)
- PBX user → CDR reports: requests report
- Call details → CDR database: queries records (evidence: `functions.inc.php`)
- Call details → Recording files: references recordings
- Call details → Recording download: includes handler (evidence: `functions.inc.php`)
- Recording download → Recording files: reads file (evidence: `download.php`)
- Call details → PDF export: generates PDF (evidence: `functions.inc.php`)
