Skip to content

goit

Outbound call queue integration for GoIT.

Flow

  1. External caller POSTs phone numbers (single or bulk) to this integration.
  2. Numbers are enqueued into goit_calls (D1).
  3. The queue dispatches up to concurrency_limit calls at a time via PlatformApiClient.originateCall.
  4. Voice Assistant posts media_start / media_end events back to /webhook/call-events. On media_end the queue releases a slot and starts the next queued call (or schedules a retry if the call was too short).
  5. The hourly retry cron processes pending_retry calls inside retry windows and picks up any leftover queued numbers.

GoIT configures their own before-call / post-call webhooks directly in the Voice Assistant platform — this integration only originates calls and tracks queue state.

Endpoints

MethodPathPurpose
POST/webhook/call-originateEnqueue one phone number
POST/webhook/call-originate-bulkEnqueue a batch (up to 1000+)
POST/webhook/call-eventsmedia_start / media_end from Voice Assistant

POST /webhook/call-originate

json
{ "phone_number": "+380991234567" }

POST /webhook/call-originate-bulk

json
{ "phone_numbers": ["+380991234567", "+380991234568", "..."] }

Response contains per-number result plus aggregate counters (queued, started, deduplicated, invalid, failed).

Secrets

KeyPurpose
PLATFORM_ASSISTANT_IDVoice Assistant agent ID used for outbound calls

Platform URL and access token come from the shared env (PLATFORM_API_URL, PLATFORM_ACCESS_TOKEN).

KV config

Set via /setup or admin UI (keys live in goit_* KV namespace).

KeyDefaultNotes
call_handling.concurrency_limit3Max calls in parallel
call_handling.failed_call_duration_threshold5Seconds; calls shorter than this are retried
retry.max_attempts3Max retry attempts per number
retry.windows[10:40, 13:40, 16:40]Times of day when retries fire

DB

Single table goit_calls, generated by generateCallsMigration("goit") from @happ-integ/call-queue. Apply migrations via POST /goit/setup.