# magnussolution/magnusbilling7 architecture

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

- Interactive diagram: https://gitdiagram.com/magnussolution/magnusbilling7
- Repository: https://github.com/magnussolution/magnusbilling7

## Overview

MagnusBilling 7 is a legacy Asterisk billing and telephony-management application. An operator or customer uses the ExtJS interface to sign in and manage telephony, accounts, campaigns, and reports; the Yii backend serves those operations against domain models and billing records, with Asterisk providing telephony control. The graph preserves the documented Yii, ExtJS, and Asterisk roles and major domain areas visible in the tree. Some feature directories are represented at directory level; unsampled implementation details and wiring are not asserted.

Main entry points: [`protected/controllers/AuthenticationController.php`](https://github.com/magnussolution/magnusbilling7/blob/source/protected/controllers/AuthenticationController.php) (Authentication), [`protected/models/Call.php`](https://github.com/magnussolution/magnusbilling7/blob/source/protected/models/Call.php) (Call records), [`protected/controllers/CallController.php`](https://github.com/magnussolution/magnusbilling7/blob/source/protected/controllers/CallController.php) (Call operations), [`protected/components/UserCreditManager.php`](https://github.com/magnussolution/magnusbilling7/blob/source/protected/components/UserCreditManager.php) (Credit management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web interface"]
  node_extjs["ExtJS modules"]
  node_mainui["Main and login UI"]
  node_stores["Data stores"]
end

subgraph group_backend["Application backend"]
  node_yii["Yii request framework<br/>[CController.php]"]
  node_auth["Authentication"]
  node_basecontroller["Shared API controller<br/>[BaseController.php]"]
  node_access["Access management<br/>[AccessManager.php]"]
  node_logs[("User activity logs<br/>[LogUsers.php]")]
  node_moduleaccess[("Module permissions<br/>[Module.php]")]
  node_mailer["Email delivery<br/>[Mail.php]"]
end

subgraph group_domains["Billing and telephony"]
  node_user[("User accounts<br/>[User.php]")]
  node_campaign[("Campaigns<br/>[Campaign.php]")]
  node_callcontroller["Call operations<br/>[CallController.php]"]
  node_callmodel[("Call records<br/>[Call.php]")]
  node_domainmodels[("Telephony and billing models")]
  node_credit["Credit management"]
  node_services["Service processing"]
end

subgraph group_integrations["External systems"]
  node_asteriskmanager["Asterisk manager"]
  node_asterisk["Asterisk PBX"]
  node_efi["EFI API client<br/>[Request.php]"]
  node_efiresponse["EFI responses<br/>[Response.php]"]
  node_database[("Application database")]
end

node_operator(("Operator or customer"))

node_operator -->|"uses"| node_mainui
node_mainui -->|"presents modules"| node_extjs
node_extjs -.->|"loads data"| node_stores
node_extjs -.->|"sends requests"| node_yii
node_yii -.->|"routes requests"| node_auth
node_auth -->|"reads account"| node_user
node_auth -->|"checks access"| node_access
node_auth -->|"sends mail"| node_mailer
node_auth -->|"records activity"| node_logs
node_auth -->|"loads permissions"| node_moduleaccess
node_yii -->|"extends controller"| node_basecontroller
node_basecontroller -.->|"queries records"| node_database
node_callcontroller -->|"delegates CRUD"| node_basecontroller
node_callcontroller -->|"queries calls"| node_callmodel
node_callcontroller -->|"uses campaign data"| node_campaign
node_callmodel -->|"relates user"| node_user
node_callmodel -->|"relates campaign"| node_campaign
node_callmodel -->|"relates telephony data"| node_domainmodels
node_credit -->|"updates credit"| node_user
node_credit -->|"processes services"| node_services
node_credit -->|"sends notices"| node_mailer
node_access -->|"checks SIP access"| node_domainmodels
node_asteriskmanager -->|"controls calls"| node_asterisk
node_efi -->|"returns response"| node_efiresponse

click node_extjs "https://github.com/magnussolution/magnusbilling7/tree/source/classic/src/view"
click node_mainui "https://github.com/magnussolution/magnusbilling7/tree/source/classic/src/view/main"
click node_stores "https://github.com/magnussolution/magnusbilling7/tree/source/app/store"
click node_yii "https://github.com/magnussolution/magnusbilling7/blob/source/yii/framework/web/CController.php"
click node_auth "https://github.com/magnussolution/magnusbilling7/blob/source/protected/controllers/AuthenticationController.php"
click node_basecontroller "https://github.com/magnussolution/magnusbilling7/blob/source/protected/components/BaseController.php"
click node_access "https://github.com/magnussolution/magnusbilling7/blob/source/protected/components/AccessManager.php"
click node_user "https://github.com/magnussolution/magnusbilling7/blob/source/protected/models/User.php"
click node_campaign "https://github.com/magnussolution/magnusbilling7/blob/source/protected/models/Campaign.php"
click node_callcontroller "https://github.com/magnussolution/magnusbilling7/blob/source/protected/controllers/CallController.php"
click node_callmodel "https://github.com/magnussolution/magnusbilling7/blob/source/protected/models/Call.php"
click node_domainmodels "https://github.com/magnussolution/magnusbilling7/tree/source/protected/models"
click node_credit "https://github.com/magnussolution/magnusbilling7/blob/source/protected/components/UserCreditManager.php"
click node_services "https://github.com/magnussolution/magnusbilling7/blob/source/protected/components/ServicesProcess.php"
click node_logs "https://github.com/magnussolution/magnusbilling7/blob/source/protected/models/LogUsers.php"
click node_moduleaccess "https://github.com/magnussolution/magnusbilling7/blob/source/protected/models/Module.php"
click node_mailer "https://github.com/magnussolution/magnusbilling7/blob/source/protected/components/Mail.php"
click node_asteriskmanager "https://github.com/magnussolution/magnusbilling7/blob/source/resources/asterisk/AGI_AsteriskManager.Class.php"
click node_efi "https://github.com/magnussolution/magnusbilling7/blob/source/lib/efi/src/Efi/Request.php"
click node_efiresponse "https://github.com/magnussolution/magnusbilling7/blob/source/lib/efi/src/Efi/Response.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_extjs,node_mainui,node_stores toneBlue
class node_yii,node_auth,node_basecontroller,node_access,node_logs,node_moduleaccess,node_mailer toneAmber
class node_user,node_campaign,node_callcontroller,node_callmodel,node_domainmodels,node_credit,node_services toneMint
class node_asteriskmanager,node_asterisk,node_efi,node_efiresponse,node_database toneRose
class node_operator toneIndigo
```

## Components

### Web interface

- [ExtJS modules](https://github.com/magnussolution/magnusbilling7/tree/source/classic/src/view): `classic/src/view`
- [Main and login UI](https://github.com/magnussolution/magnusbilling7/tree/source/classic/src/view/main): `classic/src/view/main`
- [Data stores](https://github.com/magnussolution/magnusbilling7/tree/source/app/store): `app/store`

### Application backend

- [Yii request framework](https://github.com/magnussolution/magnusbilling7/blob/source/yii/framework/web/CController.php): `yii/framework/web/CController.php`
- [Authentication](https://github.com/magnussolution/magnusbilling7/blob/source/protected/controllers/AuthenticationController.php): `protected/controllers/AuthenticationController.php`
- [Shared API controller](https://github.com/magnussolution/magnusbilling7/blob/source/protected/components/BaseController.php): `protected/components/BaseController.php`
- [Access management](https://github.com/magnussolution/magnusbilling7/blob/source/protected/components/AccessManager.php): `protected/components/AccessManager.php`
- [User activity logs](https://github.com/magnussolution/magnusbilling7/blob/source/protected/models/LogUsers.php): `protected/models/LogUsers.php`
- [Module permissions](https://github.com/magnussolution/magnusbilling7/blob/source/protected/models/Module.php): `protected/models/Module.php`
- [Email delivery](https://github.com/magnussolution/magnusbilling7/blob/source/protected/components/Mail.php): `protected/components/Mail.php`

### Billing and telephony

- [User accounts](https://github.com/magnussolution/magnusbilling7/blob/source/protected/models/User.php): `protected/models/User.php`
- [Campaigns](https://github.com/magnussolution/magnusbilling7/blob/source/protected/models/Campaign.php): `protected/models/Campaign.php`
- [Call operations](https://github.com/magnussolution/magnusbilling7/blob/source/protected/controllers/CallController.php): `protected/controllers/CallController.php`
- [Call records](https://github.com/magnussolution/magnusbilling7/blob/source/protected/models/Call.php): `protected/models/Call.php`
- [Telephony and billing models](https://github.com/magnussolution/magnusbilling7/tree/source/protected/models): `protected/models`
- [Credit management](https://github.com/magnussolution/magnusbilling7/blob/source/protected/components/UserCreditManager.php): `protected/components/UserCreditManager.php`
- [Service processing](https://github.com/magnussolution/magnusbilling7/blob/source/protected/components/ServicesProcess.php): `protected/components/ServicesProcess.php`

### External systems

- [Asterisk manager](https://github.com/magnussolution/magnusbilling7/blob/source/resources/asterisk/AGI_AsteriskManager.Class.php): `resources/asterisk/AGI_AsteriskManager.Class.php`
- **Asterisk PBX**
- [EFI API client](https://github.com/magnussolution/magnusbilling7/blob/source/lib/efi/src/Efi/Request.php): `lib/efi/src/Efi/Request.php`
- [EFI responses](https://github.com/magnussolution/magnusbilling7/blob/source/lib/efi/src/Efi/Response.php): `lib/efi/src/Efi/Response.php`
- **Application database**

### Other components

- **Operator or customer**

## Connections

- Operator or customer → Main and login UI: uses (evidence: `README.md`)
- Main and login UI → ExtJS modules: presents modules (evidence: `README.md`)
- ExtJS modules → Data stores: loads data
- ExtJS modules → Yii request framework: sends requests
- Yii request framework → Authentication: routes requests
- Authentication → User accounts: reads account (evidence: `protected/controllers/AuthenticationController.php`)
- Authentication → Access management: checks access (evidence: `protected/controllers/AuthenticationController.php`)
- Authentication → Email delivery: sends mail (evidence: `protected/controllers/AuthenticationController.php`)
- Authentication → User activity logs: records activity (evidence: `protected/controllers/AuthenticationController.php`)
- Authentication → Module permissions: loads permissions (evidence: `protected/controllers/AuthenticationController.php`)
- Yii request framework → Shared API controller: extends controller (evidence: `protected/components/BaseController.php`)
- Shared API controller → Application database: queries records
- Call operations → Shared API controller: delegates CRUD (evidence: `protected/controllers/CallController.php`)
- Call operations → Call records: queries calls (evidence: `protected/controllers/CallController.php`)
- Call operations → Campaigns: uses campaign data (evidence: `protected/controllers/CallController.php`)
- Call records → User accounts: relates user (evidence: `protected/models/Call.php`)
- Call records → Campaigns: relates campaign (evidence: `protected/models/Call.php`)
- Call records → Telephony and billing models: relates telephony data (evidence: `protected/models/Call.php`)
- Credit management → User accounts: updates credit (evidence: `protected/components/UserCreditManager.php`)
- Credit management → Service processing: processes services (evidence: `protected/components/UserCreditManager.php`)
- Credit management → Email delivery: sends notices (evidence: `protected/components/UserCreditManager.php`)
- Access management → Telephony and billing models: checks SIP access (evidence: `protected/components/AccessManager.php`)
- Asterisk manager → Asterisk PBX: controls calls (evidence: `README.md`)
- EFI API client → EFI responses: returns response (evidence: `lib/efi/src/Efi/Request.php`)
