M6 + M0: hardening, deploy docs, PoC scripts

- Pipeline-down fallback: dialplan plays gogo-fallback after a failed
  AudioSocket (§15) + script to synthesize the Bosnian prompt via TTS
- Voice heartbeat file → /health/voice endpoint + live status in admin panel
- Retention job also purges stale call registrations; chat sessions metered;
  100%-usage super-admin alert email (GOGO_ADMIN_ALERT_EMAIL)
- .env.example, docs/DEPLOY.md (compose stack, GPU node, backups pg_dump,
  update procedure, security notes)
- §16 Definition of Done as an automated test: softphone-style call → fake
  partner availability → request pushed → webhook confirm → console SMS
- M0 PoC scripts: STT accuracy harness (CER/WER + spoken-digit check; dry-run
  verified with espeak-ng samples + faster-whisper small on CPU — phone number
  extracted exactly), TTS bake-off (Azure vs ElevenLabs, latency+cost), and
  end-to-end latency smoke test speaking real AudioSocket to the live pipeline

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-11 11:27:05 +02:00
parent de5a2abdeb
commit fd45ff84dc
16 changed files with 733 additions and 5 deletions

46
.env.example Normal file
View File

@@ -0,0 +1,46 @@
# Gogo Telefon — copy to .env and fill in. All variables are prefixed GOGO_.
# Core
GOGO_ENV=prod
GOGO_SECRET_KEY=change-me-long-random-string # sessions, action links, secret encryption
GOGO_BASE_URL=https://app.gogotelefon.ba # public URL (action links, transcripts, widget)
GOGO_DATABASE_URL=postgresql+psycopg://gogo:gogo@db:5432/gogo
GOGO_INTERNAL_TOKEN=change-me-dialplan-token # Asterisk dialplan ↔ backend
# LLM (agent)
GOGO_ANTHROPIC_API_KEY=sk-ant-...
GOGO_LLM_MODEL=claude-haiku-4-5-20251001
# TTS — one of the two (default decided by the Phase-0 bake-off)
GOGO_TTS_PROVIDER=azure # azure | elevenlabs
GOGO_AZURE_SPEECH_KEY=
GOGO_AZURE_SPEECH_REGION=westeurope
GOGO_ELEVENLABS_API_KEY=
# STT (voice service)
GOGO_WHISPER_MODEL=large-v3 # small for CPU dev
GOGO_WHISPER_DEVICE=cuda # cuda | cpu | auto
# Email (proposal emails to owners)
GOGO_EMAIL_PROVIDER=smtp # console for dev
GOGO_SMTP_HOST=mail.example.ba
GOGO_SMTP_PORT=587
GOGO_SMTP_USER=
GOGO_SMTP_PASSWORD=
GOGO_EMAIL_FROM="Gogo Telefon <noreply@gogotelefon.ba>"
GOGO_ADMIN_ALERT_EMAIL= # super-admin alerts (100% usage)
# SMS (via GSM gateway, M5; console logs SMS in dev)
GOGO_SMS_PROVIDER=console # console | gsm_gateway
GOGO_GSM_GATEWAY_URL=http://192.168.1.50
GOGO_GSM_GATEWAY_USER=admin
GOGO_GSM_GATEWAY_PASSWORD=
# Google Calendar OAuth (free/busy read-only, §8.1)
GOGO_GOOGLE_CLIENT_ID=
GOGO_GOOGLE_CLIENT_SECRET=
# Voice pipeline
GOGO_VOICE_PORT=9092
GOGO_RECORDINGS_DIR=/data/recordings
GOGO_AUDIO_RETENTION_DAYS=90