Skip to Content
Dialtone

Architecture

Services, ports, data and how a call flows through them.

Services

All services are defined in deploy/docker-compose.yml (compose project dialtone) and use host networking.

ServiceImageListens onRole
redisredis:7.4-alpine127.0.0.1:REDIS_PORT (6380)LiveKit state; SIP trunks and dispatch rules (persisted, AOF)
postgrespostgres:16.4-alpine127.0.0.1:5432Server database
livekitlivekit/livekit-server7880 (signalling), 7881/TCP, UDP 50000-60000, :6789 metricsRooms and media; sends webhooks to the server
siplivekit/sip5060, UDP 10000-20000, :6790 metricsSIP ↔ LiveKit bridge
egresslivekit/egress:6791 metricsAudio-only call recordings to the dashboard-data volume
dialtone-serverbuilt from server/127.0.0.1:DASHBOARD_PORT (8787)Django: console API, /admin/, LiveKit webhook, agent runtime API
dialtone-consolebuilt from console/127.0.0.1:3000Next.js console; proxies /api/* to the server
dialtone-agentbuilt from agent/ (profile agent)outbound onlyLiveKit Agents worker that runs calls
dialtone-agent-simsame image (profile agent)127.0.0.1:SIM_PORT (8790)Text simulator for Test chat

Volumes: postgres-data (database), dashboard-data (recordings, legacy SQLite), redis-data, agent-cache (last published config per number).

A phone call, end to end

1. Caller dials your number ──► SIP provider ──► sip (5060)
2. sip checks the inbound trunk (numbers, allowed IPs, auth) and the dispatch rule (in Redis)
3. livekit creates room "call-…" and dispatches the AGENT_NAME worker into it
   └─► webhook room_started / participant_joined ──► dialtone-server (call appears in Live)
4. dialtone-agent joins, GET /api/runtime/config?number=…  (1.5 s budget; falls back to cache / built-in)
5. Optional: agent starts an egress recording (workspace switch + RECORDING_ENABLED), speaks consent line
6. Conversation: Gemini Live, or STT → LLM → TTS; workflow tools move between steps
   └─► POST /api/runtime/events (turns, steps, mood, captured fields) ──► Live screen
7. Call ends (outcome recorded, caller hangs up, or dead-air hang-up)
   ├─► POST /api/report (outcome, answers, summary, mood, latency)
   └─► webhook room_finished ──► call history

A report may arrive before LiveKit's room_finished webhook; a later report for the same room replaces the earlier one.

Who talks to whom

FromToHow it authenticates
Browserconsole (:3000)Session cookie (sign-in as a workspace member)
consoleserver /api/*Proxies the browser's cookie and CSRF token (DJANGO_URL, baked in at build); no CORS
LiveKitserver /webhookLiveKit webhook signature (LIVEKIT_API_KEY)
agentserver /api/runtime/*LiveKit-signed JWT, identity agent-runtime
agentserver /api/reportLiveKit-signed JWT, identity agent-report
serversimulator (:8790)LiveKit-signed JWT, identity console-sim
Browser (Voice test)LiveKit (:7880)Room token signed by the server (POST /api/agents/<id>/web-call)

Server apps

AppOwns
workspacesWorkspaces, members and roles (owner, admin, editor, viewer), auth, team invites, integration requests
instanceInstall-wide settings (project name), /api/instance/
voiceagentsAgents, versions, publishing, voices, simulation proxy, web-call tokens
workflowsWorkflow graphs, revisions, validation, AI suggestions
knowledgeKnowledge documents and revisions
callsCalls, events, reports, recordings, live calls, LiveKit webhook, dashboard, mood labels
runtimeEndpoints the agent calls during a call

Management commands (run with docker compose -f deploy/docker-compose.yml --env-file .env exec dialtone-server python manage.py …):

CommandWhat it does
seed_demo [--workspace SLUG] [--knowledge PATH]Adds the fictional Northwind Car Rentals demo to a workspace (default: the oldest, created if needed): a draft "Rental enquiry assistant" agent (persona Maya), the "Rental enquiry" workflow and the "Rental policies and pricing" knowledge document (built in, or the Markdown file at PATH). Idempotent; never publishes.
create_member EMAIL [--name N] [--role owner|admin|editor|viewer] [--workspace SLUG]Creates a console user (prompts for a password). Without --workspace it uses the only workspace.
ensure_default_workspaceCreates the "Default workspace" (slug default) if none exists. The server container runs it at startup.
createsuperuser (make server-admin)Django superuser for /admin/ and instance settings.
purge_old_call_data [--days 90] [--dry-run]Deletes transcripts and recordings older than N days.
mood_eval [--since DATE]Scores mood labels; see Mood evaluation.
purge_turnsDeletes captured caller speech after a mood evaluation.
copy_from_sqlite, import_legacy_callsOne-off migrations from older dashboards.

Agent modules

ModuleRole
agent.pyWorker entrypoint: pipelines, session wiring, call lifecycle
console_config.pyFetches and caches the published config
prompt.pyBuilds instructions: persona, script, knowledge, current step, identity fallbacks
workflow.pyPure workflow engine (no LiveKit imports)
dead_air.py, greeting.pySilence handling and the opening
sentiment.py, mood.py, adapt.py, tone.pyMood classification and tone/pace adaptation
recording.pyEgress recording and consent
events.py, report.py, metrics.pyLive events, end-of-call report, latency metrics
simulate.pyText simulator server (dialtone-agent-sim)
voices.py, behavior.pyVoice resolution and behaviour settings

On this page