Pipeline de Voz β
Fluxo de Γudio β
Telefone (PSTN 8kHz)
β
βΌ
βββββββββββββββββββββββ
β Telnyx/Twilio SIP β
β WebSocket Stream β
ββββββββββββ¬βββββββββββ
β ΞΌ-law β PCM
βΌ
βββββββββββββββββββββββ
β Deepgram STT β
β Nova-3 (PT-BR) β
β endpointing: 500ms β
ββββββββββββ¬βββββββββββ
β texto
βΌ
βββββββββββββββββββββββ
β SmartTurn V3 β
β stop: 2.5s β
β pre_speech: 500ms β
ββββββββββββ¬βββββββββββ
β
βΌ
βββββββββββββββββββββββ
β OpenAI gpt-4o-mini β
β + GHL Function Call β
β (6 tools) β
ββββββββββββ¬βββββββββββ
β texto resposta
βΌ
βββββββββββββββββββββββ
β Cartesia TTS β
β Sonic-3 (Luana) β
β + flush_audio fix β
ββββββββββββ¬βββββββββββ
β PCM β ΞΌ-law
βΌ
βββββββββββββββββββββββ
β Telnyx/Twilio SIP β
β WebSocket Stream β
ββββββββββββ¬βββββββββββ
β
βΌ
Telefone LeadSupabase Schema β
cold_call_logs β
| Coluna | Tipo | DescriΓ§Γ£o |
|---|---|---|
| id | uuid | PK |
| call_id | text | ID da chamada (Twilio/Telnyx) |
| phone | text | Telefone do lead |
| lead_name | text | Nome do lead |
| status | text | completed, failed, etc |
| outcome | text | agendou, interessado, nao_atendeu, recusou |
| duration_seconds | numeric(10,2) | DuraΓ§Γ£o em segundos |
| transcript | text | TranscriΓ§Γ£o completa |
| cost_usd | numeric(8,4) | Custo total USD |
| cost_breakdown | jsonb | Breakdown por componente |
| started_at | timestamptz | InΓcio da chamada |
cold_call_retry_queue β
| Coluna | Tipo | DescriΓ§Γ£o |
|---|---|---|
| id | uuid | PK |
| phone | text | Telefone |
| attempt_number | int | Tentativa atual |
| max_attempts | int | MΓ‘ximo configurΓ‘vel (1-6) |
| next_retry_at | timestamptz | PrΓ³ximo retry (business hours) |
| status | text | pending, paused, calling, completed, cancelled |
Custos por Chamada (~$0.04/min) β
| Componente | Custo/min | % Total |
|---|---|---|
| Telephony | $0.045 | 56% |
| TTS | $0.018 | 22% |
| STT | $0.005 | 6% |
| LLM | $0.002 | 3% |
Endpoints API β
| MΓ©todo | Endpoint | DescriΓ§Γ£o |
|---|---|---|
| GET | /health | Health check |
| GET | /costs/summary?days=30 | Custos agregados |
| GET | /calls/active | Chamadas ativas |
| GET | /retry/queue | Fila de retries |
| POST | /retry/now | Retry imediato |
| POST | /retry/cancel | Cancelar retry |
| POST | /retry/settings | Toggle auto-retry + max_attempts |
| POST | /retry/process | Processar fila (cron) |
| POST | /outbound-call | Iniciar chamada |
