Skip to main content

Architecture Overview

OPBX is a multi-tenant business PBX. The platform splits responsibilities between a control plane for configuration and management, and an execution plane for real-time call processing and external integrations.


Control Plane vs Execution Plane​

PlanePurposeComponents
Control PlaneConfigure the PBX, manage users, review call logs, and administer the platform.React SPA, Laravel API, MySQL
Execution PlaneProcess live calls, webhooks, queues, real-time events, and worker coordination.Voice routing controllers, webhook controllers, Redis queues, queue workers and scheduler, Soketi, Go dialer worker, Java/Vert.x AMD and ACD workers

The control plane changes state slowly. The execution plane responds in milliseconds to voice routing requests from Cloudonix and handles high-velocity status updates.


Service Architecture​

Component Responsibilities​

ComponentTechnologyRole
React SPAReact 19 + TypeScriptUser interface for PBX configuration, live calls, reporting, and administration.
Nginxnginx:1.27-alpineReverse proxy, static asset delivery, WebSocket upgrade routing, and worker proxying.
LaravelLaravel 12 (PHP 8.4)REST API, voice routing decisions, webhook processing, multi-tenancy, queues, and broadcasting.
Queue workers and schedulerLaravel (same image)queue-worker and queue-worker-long run background jobs; scheduler runs schedule:run every minute (retention, CDR tiering, platform health checks).
MySQLMySQL 8.4 LTSPersistent relational storage for organizations, users, calls, routing configuration, and CDRs.
RedisRedis 7 (Alpine)Caching, sessions, queues, idempotency keys, distributed locks, rate-limit counters, and real-time state.
SeaweedFSSeaweedFS 4.47 (S3-compatible)Object storage for call recordings, IVR audio, announcement files, and the CDR archive.
SoketiSoketi / Pusher protocolWebSocket server for live call updates and presence channels.
Cloudonix CPaaSCloudonix REST APIExternal VoIP platform that handles call media, SIP registration, and telephony primitives.
Dialer WorkerGoOutbound auto-dialer campaign execution and CAC/CPS limiting. Runs as a single replica.
AMD WorkerJava / Vert.x 5Stream-based answering-machine detection for outbound campaigns.
ACD WorkerJava / Vert.x 5Call queue state: FIFO order, agent states and agent selection.
MCP ServerNode.jsMCP facade over the OPBX REST API for AI assistants, served at /mcp.

Data-Store Responsibilities​

OPBX uses three data stores. Each has a clearly defined responsibility and different durability expectations.

MySQL (Source of Truth)​

MySQL stores all durable application data. Examples include:

  • Organizations, users, roles, and permissions
  • Extensions, DIDs, ring groups, IVR menus, business hours
  • Call detail records (CDRs), call logs, and session updates
  • Auto-dialer campaigns, destinations, and call sessions
  • Platform audit logs and call notification settings

MySQL data is preserved in a host bind mount (./volumes/mysql). Server settings come from docker/mysql/my.cnf, and the container is limited to 1 GB of memory. Back it up regularly with ./scripts/backup-database.sh.

Old call detail records move out of the main tables in tiers: a warm archive table (archived_call_detail_records, in the main schema unless DB_CDR_ARCHIVE_DATABASE names another one) and then a cold compressed CSV archive in object storage. See Configuration Reference.

Redis (Ephemeral Runtime State)​

Redis supports fast, transient state. It is configured with AOF persistence in the example Docker Compose file, so it survives normal restarts. The password is written to a config file inside the container instead of the command line, but treat it as operational cache/queue storage rather than a primary source of truth. Redis is used for:

  • Sessions (SESSION_DRIVER=redis)
  • Job queues (QUEUE_CONNECTION=redis)
  • Application cache (CACHE_STORE=redis)
  • Rate-limit counters (rate_limit:org:{id}:{type})
  • Webhook idempotency keys (idem:webhook:{key})
  • Distributed locks (for example cdr:create:{org}:{call_id}, lock:ring_group:{id} and lock:call_queue:{id})
  • IVR call state (ivr:call:*) and dialer CAC counters (dialer:cac:{campaign_id}:active)
  • Voice routing cache (routing:extension:*, routing:business_hours:*)
  • Cloudonix package tier per organization (cloudonix:package:{organization_id}, one hour; warmed on sign-in, refreshed by Settings Validate and Save) and the TTS voice list (cloudonix-voices:{domain_uuid}, one hour)
  • Call queue state owned by the ACD worker (acd:* keys) and extension presence (acd:presence:{org}:{extension})

Redis data is preserved in host bind mounts (./volumes/redis).

SeaweedFS (Object Storage)​

SeaweedFS provides S3-compatible object storage for binary files:

  • Call recordings
  • IVR prompts and announcements
  • Auto-dialer audio assets
  • Cold CDR archive (private cdr-archive bucket)

Data is stored in host bind mounts (./volumes/seaweedfs). External access to recordings is gated through HMAC-signed URLs generated by the Laravel backend.


Routing Planes​

Traffic TypeEntry PointHandlerOutput
Web UINginx :80React SPAHTML/JS
REST APINginx :80 /api/*Laravel controllersJSON
Voice routingNginx :80 /api/voice/*, /api/callbacks/voice/*VoiceRoutingController and the queue/ALB callback controllersCXML
Status/CDR webhooksNginx :80 /api/webhooks/cloudonix/*CloudonixWebhookControllerJSON
Auto-dialer webhooksNginx :80 /api/webhooks/auto-dialer/*, /api/webhooks/cloudonix/dialerAutoDialerWebhookController, DialerWebhookProxyControllerJSON
Audio for CloudonixNginx :80 /api/storage/recordings/{path}RecordingsController (HMAC-signed, expiring URL)Audio
Real-timeNginx :80 /app/SoketiWebSocket
AMD audio streamNginx :80 /ws/amd/AMD WorkerWebSocket
MCP clientsNginx :80 /mcpMCP ServerMCP (Streamable HTTP)
Embeddable dialerNginx :80 /embed/loader.js, /embed/dialerLaravel (own framing and permissions headers)JS / HTML
Log viewer (profile logs)Nginx :80 /logs/GrafanaHTML

Worker Services​

The execution plane includes three worker services. All three start with the standard stack:

  • Dialer Worker (Go) — Polls Laravel for active auto-dialer campaigns and asks Laravel to initiate outbound calls. It has no webhook endpoints; Laravel receives the call results from Cloudonix. Run exactly one replica.
  • AMD Worker (Java) — Receives live audio streams from Cloudonix, checks each stream's session with /api/voice/amd-session, detects voicemail beeps, and posts results to /api/voice/amd-action.
  • ACD Worker (Java) — Holds call queue state in Redis. Laravel calls it over the internal network on every queue decision.

The workers authenticate with shared tokens (DIALER_WORKER_API_TOKEN, AMD_WORKER_API_TOKEN, ACD_WORKER_API_TOKEN). The worker images run as a non-root user (uid 10001), and each has a Docker healthcheck.


Next Steps​