# realtime-node

AMI -> Redis -> WebSocket realtime service for Asterisk

Quick start

1. Copy `.env.example` to `.env` and edit values. By default the service will prefer the parent Laravel project's `.env` (two directories up) if present — you can still supply a service-local `.env`.
2. Install dependencies:

```bash
cd services/realtime-node
npm install
```

3. Start service:

```bash
npm start
```

What it does

- Connects to Asterisk AMI and listens for events
- Normalizes events and writes to Redis Streams (`realtime:events` by default)
- Publishes concise delta messages on `realtime:pub`
- Runs a WebSocket server that broadcasts deltas to connected clients

Notes

- This is a minimal scaffold. Configure reconciliation, auth, and clustering as needed for production.
