Voice API — calls and the softphone
The voice account is chosen by the Super Admin. Numbers must be E.164, e.g. +12125550120.
POST /api/voice/tokenSoftphone login token. Body: { identity }. Demo: { configured: false, identity, error: "Voice is not connected yet — the softphone runs in demo mode." }
POST /api/voice/callPlace an outbound call. Body: { to, from, amd?, fallback?, workspaceId? }. amd is detect, detect_beep or disabled. Missing/invalid numbers → 400. Blocked number or zero credits → 403 from the service gate.
GET /api/voice/callWhether voice is configured: { configured, note }.
POST /api/voice/conferenceSupervisor Listen / Whisper / Barge. Body: { mode, agentId }. mode must be listen, whisper or barge (else 400). Live use needs a Super Admin, Admin or Supervisor session.
curl -X POST https://dialmora.com/api/voice/call \
-H "Content-Type: application/json" \
-d '{"to": "+12125550120", "from": "+12125550101", "amd": "detect"}'
# Demo-mode response (no voice account live yet):
{"configured": false,
"error": "Voice provider not configured (placeholder key)"}