Worker Services
OPBX uses standalone worker services for specialized runtime tasks:
| Worker | Technology | Purpose |
|---|---|---|
| Dialer Worker | Go | Executes outbound auto-dialer campaigns |
| AMD Worker | Java/Vert.x 5 | Detects voicemail beeps in live audio streams |
| ACD Worker | Java/Vert.x 5 | Runs call queue state (FIFO, agent states, selection strategies) |
All workers run as Docker services in the standard Docker Compose stack and start with a plain docker compose up -d. They communicate with the Laravel backend through REST APIs and Redis.
| Worker | Talks to | Auth token | Healthcheck |
|---|---|---|---|
| Dialer | Laravel API (polls it), Redis | DIALER_WORKER_API_TOKEN | GET /webhooks/health on 8081 |
| AMD | Cloudonix audio via Nginx /ws/amd/; Laravel callbacks | AMD_WORKER_API_TOKEN | GET /health on 8083 |
| ACD | Called by Laravel; Redis | ACD_WORKER_API_TOKEN | GET /health on 8085 (fails when Redis is down) |
All three images run as a non-root user (uid 10001), and none publishes a host port by default (docker-compose.ports.yml can publish the dialer worker's health port on 127.0.0.1:8181 for local tools). The workers refuse to start when their token is empty or a shipped placeholder, and Laravel refuses to boot in production without the three tokens.
The Platform Status page probes each worker's health address every minute (PLATFORM_STATUS_DIALER_URL, PLATFORM_STATUS_AMD_URL, PLATFORM_STATUS_ACD_URL), and the Auto Dialer's Real Time Monitor shows the dialer worker's health (DIALER_WORKER_HEALTH_URL).
The PHP side has its own background services in the same stack: queue-worker and queue-worker-long (Laravel queue workers) and scheduler (runs schedule:run every minute). Their healthchecks check that the process is alive; the scheduler touches a heartbeat file on every tick and is unhealthy when it is older than 3 minutes.
When to Read These Guides
Read the worker guides when you need to:
- Understand how outbound campaigns are executed
- Build or run a worker locally
- Configure worker environment variables
- Troubleshoot campaign or AMD issues
Common Commands
View Worker Logs
docker compose logs -f dialer-worker
docker compose logs -f amd-worker
docker compose logs -f acd-worker
Or enable the centralized logging stack to search all worker logs (and Laravel's) in one place, including per-call audit trails by Cloudonix session token.
Dialer Worker Replicas
Run exactly one dialer worker. The compose file pins replicas: 1 because call pacing (CPS) is held in the worker's memory; a second replica would double the dial rate. Do not use --scale dialer-worker.
Restart a Worker
docker compose restart dialer-worker
docker compose restart amd-worker
docker compose restart acd-worker
Wait 120 seconds after restarting the full stack before testing worker functionality.