initiateCall (outbound.ts)

openclaw-voice-call-realtime · outbound-calling, voice, call-state-management, timer-management

Initiates outbound calls through a telephony provider, handling state management, configuring duration and transcript timers, and persisting call records.

// Source: https://github.com/TristanBrotherton/openclaw-voice-call-realtime | License: MIT | Copyright 2026 OpenClaw Foundation (original voice-call plugin)
// Provided via justclaw.it.com; keep this notice with the code.
import crypto from "node:crypto";
import type { CallMode, CallScreeningConfig } from "../config.js";
import {
  TerminalStates,
  type CallId,
  type CallRecord,
  type OutboundCallOptions,
} from "../types.js";
import { mapVoiceToPolly } from "../voice-mapping.js";
import type { CallManagerContext } from "./context.js";
import { getCallByProviderCallId } from "./lookup.js";
import { addTranscriptEntry, transitionState } from "./state.js";
import { persistCallRecord } from "./store.js";
import {
  clearMaxDurationTimer,
  clearTranscriptWaiter,
  rejectTranscriptWaiter,


... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search 40K more like it.

Get a free API key