# celer228/sipcall architecture

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

- Interactive diagram: https://gitdiagram.com/celer228/sipcall
- Repository: https://github.com/celer228/sipcall

## Overview

SIPCALL is an HTTP API for initiating calls, with documented endpoints at `/api/call` and `/api/call/<UserID>`. The tree suggests separate call handling, SIP client/server, user handling, and OTP application/supervision components. No source excerpts were provided, so internal call paths and runtime wiring cannot be verified; dashed edges mark those uncertainties.

Main entry points: [`src/call_handler.erl`](https://github.com/celer228/sipcall/blob/master/src/call_handler.erl) (Call API), [`src/sipcall_sup.erl`](https://github.com/celer228/sipcall/blob/master/src/sipcall_sup.erl) (Supervisor), [`src/users_handler.erl`](https://github.com/celer228/sipcall/blob/master/src/users_handler.erl) (Users API), [`src/sipcall_app.erl`](https://github.com/celer228/sipcall/blob/master/src/sipcall_app.erl) (Application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["HTTP API"]
  node_call_api["Call API<br/>[call_handler.erl]"]
  node_users_api["Users API<br/>[users_handler.erl]"]
  node_user_data["User data<br/>[users.json]"]
end

subgraph group_sip["SIP calling"]
  node_sip_client["SIP client<br/>[sip_client.erl]"]
  node_sip_server["SIP server<br/>[sip_server.erl]"]
end

subgraph group_runtime["OTP runtime"]
  node_app["Application<br/>[sipcall_app.erl]"]
  node_supervisor["Supervisor<br/>[sipcall_sup.erl]"]
end

node_caller(("HTTP caller"))

node_caller -->|"requests calls"| node_call_api
node_call_api -.->|"dispatches calls"| node_sip_client
node_call_api -.->|"uses user handling"| node_users_api
node_users_api -.->|"reads users"| node_user_data
node_app -.->|"starts supervision"| node_supervisor
node_supervisor -.->|"starts handler"| node_call_api
node_supervisor -.->|"starts server"| node_sip_server

click node_call_api "https://github.com/celer228/sipcall/blob/master/src/call_handler.erl"
click node_users_api "https://github.com/celer228/sipcall/blob/master/src/users_handler.erl"
click node_user_data "https://github.com/celer228/sipcall/blob/master/priv/users.json"
click node_sip_client "https://github.com/celer228/sipcall/blob/master/src/sip_client.erl"
click node_sip_server "https://github.com/celer228/sipcall/blob/master/src/sip_server.erl"
click node_app "https://github.com/celer228/sipcall/blob/master/src/sipcall_app.erl"
click node_supervisor "https://github.com/celer228/sipcall/blob/master/src/sipcall_sup.erl"

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_call_api,node_users_api,node_user_data toneBlue
class node_sip_client,node_sip_server toneAmber
class node_app,node_supervisor toneMint
class node_caller toneIndigo
```

## Components

### HTTP API

- [Call API](https://github.com/celer228/sipcall/blob/master/src/call_handler.erl): `src/call_handler.erl`
- [Users API](https://github.com/celer228/sipcall/blob/master/src/users_handler.erl): `src/users_handler.erl`
- [User data](https://github.com/celer228/sipcall/blob/master/priv/users.json): `priv/users.json`

### SIP calling

- [SIP client](https://github.com/celer228/sipcall/blob/master/src/sip_client.erl): `src/sip_client.erl`
- [SIP server](https://github.com/celer228/sipcall/blob/master/src/sip_server.erl): `src/sip_server.erl`

### OTP runtime

- [Application](https://github.com/celer228/sipcall/blob/master/src/sipcall_app.erl): `src/sipcall_app.erl`
- [Supervisor](https://github.com/celer228/sipcall/blob/master/src/sipcall_sup.erl): `src/sipcall_sup.erl`

### Other components

- **HTTP caller**

## Connections

- HTTP caller → Call API: requests calls (evidence: `README.md`)
- Call API → SIP client: dispatches calls
- Call API → Users API: uses user handling
- Users API → User data: reads users
- Application → Supervisor: starts supervision
- Supervisor → Call API: starts handler
- Supervisor → SIP server: starts server
