Broadcast Audit
:::info Status Implemented. :::
Tracks every azaan/live broadcast with delivery analytics — one audit row per broadcast (live or offline azan, live announcements/khutbah), recording per-provider push send/failure counts, MQTT delivery timing, and error detail. This is the data source behind the Super Admin Broadcast Audit screen.
Where it's written
Every broadcast fan-out path writes to broadcast_audit_logs via
core/audit_writer.py:
- Live azan start/end —
core/live_broadcast.py:notify_icecast_broadcast_started/ended(see Azaan Broadcast). - Offline azan —
core/azan_scheduler.py:_fire_offline_azan, withbroadcast_type='azaan_offline'distinguishing it from a live azan's'azaan_broadcast'.
broadcast_id is a UUID, unique per event; a start and its matching end use
different audit UUIDs, correlated by prayer_name (the end event's name is
suffixed "ended").
Core modules
| File | Role |
|---|---|
core/audit_models.py | Audit row shapes |
core/audit_writer.py | write_audit_complete and friends — the only writer of broadcast_audit_logs |
core/live_broadcast.py | Calls the writer from both start and end fan-out |
api/v1/endpoints/broadcast_audit.py | Read API for the Super Admin screen |
API
| Endpoint | Purpose |
|---|---|
GET /api/v1/broadcast-audit/mosque/{mosque_id}/broadcasts | List broadcasts for a mosque |
GET /api/v1/broadcast-audit/mosque/{mosque_id}/broadcasts/print | Printable report |
GET /api/v1/broadcast-audit/mosque/{mosque_id}/summary | Aggregate delivery stats |
GET /api/v1/broadcast-audit/broadcast/{broadcast_id} | Single broadcast detail |
GET /api/v1/broadcast-audit/mosque/{mosque_id}/errors | Delivery errors for a mosque |
GET /api/v1/broadcast-audit/broadcast/{broadcast_id}/failed-recipients | Recipients a push failed to reach |
GET /api/v1/broadcast-audit/mosque/{mosque_id}/in-progress | Currently on-air broadcasts |
Full schemas: API Reference.
UI
Super-admin → Broadcast Audit shows an offline azan as an amber Azaan · Offline chip, and can filter online vs. offline broadcasts.