Skip to main content

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, with broadcast_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

FileRole
core/audit_models.pyAudit row shapes
core/audit_writer.pywrite_audit_complete and friends — the only writer of broadcast_audit_logs
core/live_broadcast.pyCalls the writer from both start and end fan-out
api/v1/endpoints/broadcast_audit.pyRead API for the Super Admin screen

API

EndpointPurpose
GET /api/v1/broadcast-audit/mosque/{mosque_id}/broadcastsList broadcasts for a mosque
GET /api/v1/broadcast-audit/mosque/{mosque_id}/broadcasts/printPrintable report
GET /api/v1/broadcast-audit/mosque/{mosque_id}/summaryAggregate delivery stats
GET /api/v1/broadcast-audit/broadcast/{broadcast_id}Single broadcast detail
GET /api/v1/broadcast-audit/mosque/{mosque_id}/errorsDelivery errors for a mosque
GET /api/v1/broadcast-audit/broadcast/{broadcast_id}/failed-recipientsRecipients a push failed to reach
GET /api/v1/broadcast-audit/mosque/{mosque_id}/in-progressCurrently 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.