mock (dev, no network), plivo (Voice API + XML transfer +
GetInput speech), telnyx (Call Control v2), twilio (Programmable Voice +
Media Streams).
The Voice Call plugin runs inside the Gateway process. If you use a
remote Gateway, install and configure the plugin on the machine running the
Gateway, then restart the Gateway to load it.
Quick start
Install the plugin
- From npm
- From a local folder (dev)
Configure provider and webhook
Set config under
plugins.entries.voice-call.config (see
Configuration below). At minimum: provider, provider
credentials, fromNumber, and a publicly reachable webhook URL.Verify setup
streaming or realtime) is active.Configuration
Ifenabled: true but the selected provider is missing credentials, Gateway
startup logs a setup-incomplete warning with the missing keys and skips
starting the runtime. Commands, RPC calls, and agent tools still return the
exact missing configuration when used.
Voice-call credentials accept SecretRefs.
plugins.entries.voice-call.config.twilio.authToken, plugins.entries.voice-call.config.realtime.providers.*.apiKey, plugins.entries.voice-call.config.streaming.providers.*.apiKey, and plugins.entries.voice-call.config.tts.providers.*.apiKey resolve through the standard SecretRef surface; see SecretRef credential surface.Config reference
Top-level keys underplugins.entries.voice-call.config not shown above:
| Key | Default | Notes |
|---|---|---|
enabled | false | Master on/off switch. |
inboundPolicy | "disabled" | disabled | allowlist | pairing | open. See Inbound calls. |
allowFrom | [] | E.164 allowlist for inboundPolicy: "allowlist". |
maxDurationSeconds | 300 | Hard per-call duration cap, enforced regardless of answered state. |
staleCallReaperSeconds | 120 | See Stale call reaper. 0 disables it. |
silenceTimeoutMs | 800 | End-of-speech silence detection for the classic (non-realtime) flow. |
transcriptTimeoutMs | 180000 | Max wait for a caller transcript before giving up on a turn. |
ringTimeoutMs | 30000 | Ring timeout for outbound calls. |
maxConcurrentCalls | 1 | Outbound calls beyond this limit are rejected. |
outbound.notifyHangupDelaySec | 3 | Seconds to wait after TTS before auto-hangup in notify mode. |
skipSignatureVerification | false | Local testing only; never enable in production. |
store | unset | Overrides the default ~/.openclaw/voice-calls call-log path. |
agentId | "main" | Agent used for response generation and session storage. |
responseModel | unset | Overrides the default model for classic (non-realtime) responses. |
responseSystemPrompt | generated | Custom system prompt for classic responses. |
responseTimeoutMs | 30000 | Timeout for classic response generation (ms). |
Provider exposure and security notes
Provider exposure and security notes
- Twilio, Telnyx, and Plivo all require a publicly reachable webhook URL.
mockis a local dev provider (no network calls).- Telnyx requires
telnyx.publicKey(orTELNYX_PUBLIC_KEY) unlessskipSignatureVerificationis true. skipSignatureVerificationis for local testing only.- On ngrok free tier, set
publicUrlto the exact ngrok URL; signature verification is always enforced. tunnel.allowNgrokFreeTierLoopbackBypass: trueallows Twilio webhooks with invalid signatures only whentunnel.provider="ngrok"andserve.bindis loopback (ngrok local agent). Local dev only.- Ngrok free-tier URLs can change or add interstitial behavior; if
publicUrldrifts, Twilio signatures fail. Production: prefer a stable domain or a Tailscale funnel.
Streaming connection caps
Streaming connection caps
streaming.preStartTimeoutMs(default5000) closes sockets that never send a validstartframe.streaming.maxPendingConnections(default32) caps total unauthenticated pre-start sockets.streaming.maxPendingConnectionsPerIp(default4) caps unauthenticated pre-start sockets per source IP.streaming.maxConnections(default128) caps all open media stream sockets (pending + active).
Legacy config migrations
Legacy config migrations
Config parsing normalizes these legacy keys automatically and logs a
warning naming the replacement path; the shim is removed in a future
release (
2026.6.0), so run openclaw doctor --fix to rewrite committed
config to the canonical shape:provider: "log"→provider: "mock"twilio.from→fromNumberstreaming.sttProvider→streaming.providerstreaming.openaiApiKey→streaming.providers.openai.apiKeystreaming.sttModel→streaming.providers.openai.modelstreaming.silenceDurationMs→streaming.providers.openai.silenceDurationMsstreaming.vadThreshold→streaming.providers.openai.vadThresholdrealtime.agentContext.includeSystemPromptis removed (realtime context now uses the generated agent prompt)
Session scope
By default, Voice Call usessessionScope: "per-phone" so repeat calls from
the same caller keep conversation memory. Set sessionScope: "per-call" when
each carrier call should start with fresh context, for example reception,
booking, IVR, or Google Meet bridge flows where the same phone number may
represent different meetings.
Voice Call stores generated session keys under the configured agent namespace
(agent:<agentId>:voice:*). Raw explicit integration keys resolve into the
same namespace: a canonical agent:<configuredAgentId>:* key keeps that
owner and honors core session.mainKey/global-scope aliasing; foreign or
malformed agent:* input is scoped as an opaque key under the configured
agent; global and unknown remain global sentinels.
Realtime voice conversations
realtime selects a full-duplex realtime voice provider for live call audio.
It is separate from streaming, which only forwards audio to realtime
transcription providers.
Current runtime behavior:
realtime.enabledis supported for Twilio and Telnyx.realtime.provideris optional. If unset, Voice Call uses the first registered realtime voice provider.- Bundled realtime voice providers: Google Gemini Live (
google) and OpenAI (openai), registered by their provider plugins. - Provider-owned raw config lives under
realtime.providers.<providerId>. - Voice Call exposes the shared
openclaw_agent_consultrealtime tool by default. The realtime model can call it when the caller asks for deeper reasoning, current information, or normal OpenClaw tools. realtime.consultPolicyoptionally adds guidance for when the realtime model should callopenclaw_agent_consult.realtime.agentContext.enabledis default-off. When enabled, Voice Call injects a bounded agent identity and selected workspace-file capsule into the realtime provider instructions at session setup.realtime.fastContext.enabledis default-off. When enabled, Voice Call first searches indexed memory/session context for the consult question and returns those snippets to the realtime model withinrealtime.fastContext.timeoutMsbefore falling back to the full consult agent only ifrealtime.fastContext.fallbackToConsultis true.- If
realtime.providerpoints at an unregistered provider, or no realtime voice provider is registered at all, Voice Call logs a warning and skips realtime media instead of failing the whole plugin. inboundPolicymust not be"disabled"whenrealtime.enabledis true;validateProviderConfigrejects that combination.- Consult session keys reuse the stored call session when available, then fall back to the configured
sessionScope(per-phoneby default, orper-callfor isolated calls).
Tool policy
realtime.toolPolicy controls the consult run:
| Policy | Behavior |
|---|---|
safe-read-only | Expose the consult tool and limit the regular agent to read, web_search, web_fetch, x_search, memory_search, and memory_get. |
owner | Expose the consult tool and let the regular agent use the normal agent tool policy. |
none | Do not expose the consult tool. Custom realtime.tools are still passed through to the realtime provider. |
realtime.consultPolicy controls only the realtime model instructions:
| Policy | Guidance |
|---|---|
auto | Keep the default prompt and let the provider decide when to call the consult tool. |
substantive | Answer simple conversational glue directly and consult before facts, memory, tools, or context. |
always | Consult before every substantive answer. |
Agent voice context
Enablerealtime.agentContext when the voice bridge should sound like the
configured OpenClaw agent without paying a full agent-consult round trip on
ordinary turns. The context capsule is added once when the realtime session
is created, so it does not add per-turn latency. Calls to
openclaw_agent_consult still run the full OpenClaw agent and should be used
for tool work, current information, memory lookups, or workspace state.
Realtime provider examples
- Google Gemini Live
- OpenAI
Defaults: API key from
realtime.providers.google.apiKey, GEMINI_API_KEY,
or GOOGLE_API_KEY; model gemini-2.5-flash-native-audio-preview-12-2025;
voice Kore. sessionResumption and contextWindowCompression default on
for longer, reconnectable calls. Use silenceDurationMs,
startSensitivity, and endSensitivity to tune faster turn-taking on
telephony audio.Streaming transcription
streaming selects a realtime transcription provider for live call audio.
Current runtime behavior:
streaming.provideris optional. If unset, Voice Call uses the first registered realtime transcription provider.- Bundled realtime transcription providers: Deepgram (
deepgram), ElevenLabs (elevenlabs), Mistral (mistral), OpenAI (openai), and xAI (xai), registered by their provider plugins. - Provider-owned raw config lives under
streaming.providers.<providerId>. - After Twilio sends an accepted stream
startmessage, Voice Call registers the stream immediately, queues inbound media through the transcription provider while the provider connects, and starts the initial greeting only after realtime transcription is ready. - If
streaming.providerpoints at an unregistered provider, or none is registered, Voice Call logs a warning and skips media streaming instead of failing the whole plugin.
Streaming provider examples
- OpenAI
- xAI
Defaults: API key
streaming.providers.openai.apiKey or
OPENAI_API_KEY; model gpt-4o-transcribe; silenceDurationMs: 800;
vadThreshold: 0.5.TTS for calls
Voice Call uses the coremessages.tts configuration for streaming speech on
calls. You can override it under the plugin config with the same shape —
it deep-merges with messages.tts.
- Legacy
tts.<provider>keys inside plugin config (openai,elevenlabs,microsoft,edge) are repaired byopenclaw doctor --fix; committed config should usetts.providers.<provider>. - Core TTS is used when Twilio media streaming is enabled; otherwise calls fall back to provider-native voices.
- If a Twilio media stream is already active, Voice Call does not fall back to TwiML
<Say>. If telephony TTS is unavailable in that state, the playback request fails instead of mixing two playback paths. - When telephony TTS falls back to a secondary provider, Voice Call logs a warning with the provider chain (
from,to,attempts) for debugging. - When Twilio barge-in or stream teardown clears the pending TTS queue, queued playback requests settle instead of hanging callers awaiting playback completion.
TTS examples
- Core TTS only
- Override to ElevenLabs (calls only)
- OpenAI model override (deep-merge)
Inbound calls
Inbound policy defaults todisabled. To enable inbound calls, set:
responseModel,
responseSystemPrompt, and responseTimeoutMs.
Per-number routing
Usenumbers when one Voice Call plugin receives calls for multiple phone
numbers and each number should behave like a different line. For example,
one number can use a casual personal assistant while another uses a business
persona, a different response agent, and a different TTS voice.
Routes are selected from the provider-supplied dialed To number. Keys must
be E.164 numbers. When a call arrives, Voice Call resolves the matching
route once, stores the matched route on the call record, and reuses that
effective config for the greeting, classic auto-response path, realtime
consult path, and TTS playback. If no route matches, the global Voice Call
config is used. Outbound calls do not use numbers; pass the outbound
target, message, and session explicitly when initiating the call.
Route overrides currently support:
inboundGreetingttsagentIdresponseModelresponseSystemPromptresponseTimeoutMs
tts route value deep-merges over the global Voice Call tts config, so
you can usually override only the provider voice:
Spoken output contract
For auto-responses, Voice Call appends a strict spoken-output contract to the system prompt requiring a{"spoken":"..."} JSON reply. Voice Call
extracts speech text defensively:
- Ignores payloads marked as reasoning/error content.
- Parses direct JSON, fenced JSON, or inline
"spoken"keys. - Falls back to plain text and removes likely planning/meta lead-in paragraphs.
Conversation startup behavior
For outboundconversation calls, first-message handling is tied to live
playback state:
- Barge-in queue clear and auto-response are suppressed only while the initial greeting is actively speaking.
- If initial playback fails, the call returns to
listeningand the initial message remains queued for retry. - Initial playback for Twilio streaming starts on stream connect without extra delay.
- Barge-in aborts active playback and clears queued-but-not-yet-playing Twilio TTS entries. Cleared entries resolve as skipped, so follow-up response logic can continue without waiting on audio that will never play.
- Realtime voice conversations use the realtime stream’s own opening turn. Voice Call does not post a legacy
<Say>TwiML update for that initial message, so outbound<Connect><Stream>sessions stay attached.
Twilio stream disconnect grace
When a Twilio media stream disconnects, Voice Call waits 2000 ms before auto-ending the call:- If the stream reconnects during that window, auto-end is canceled.
- If no stream re-registers after the grace period, the call is ended to prevent stuck active calls.
Stale call reaper
UsestaleCallReaperSeconds (default 120) to end calls that are never
answered and never reach a live conversation state, for example notify-mode
calls where the provider never delivers a terminal webhook. Set it to 0 to
disable.
The reaper runs every 30 seconds and only ends calls that have no
answeredAt timestamp and are not already in a terminal or live
(speaking/listening) state, so answered conversations are never reaped
by this timer; maxDurationSeconds (default 300) is the separate cap that
ends answered calls that run too long.
For notify-style flows where carriers can be slow to deliver ring/answer
webhooks, raise staleCallReaperSeconds past the default so slow-but-normal
calls are not reaped early; 120-300 seconds is a reasonable production
range.
Webhook security
When a proxy or tunnel sits in front of the Gateway, the plugin reconstructs the public URL for signature verification. These options control which forwarded headers are trusted:Allowlist hosts from forwarding headers.
Trust forwarded headers without an allowlist.
Only trust forwarded headers when the request remote IP matches the list.
- Webhook replay protection is enabled for Twilio, Telnyx, and Plivo. Replayed valid webhook requests are acknowledged but skipped for side effects.
- Twilio conversation turns include a per-turn token in
<Gather>callbacks, so stale/replayed speech callbacks cannot satisfy a newer pending transcript turn. - Unauthenticated webhook requests are rejected before body reads when the provider’s required signature headers are missing.
- The voice-call webhook uses the shared pre-auth body-read profile (64 KB max body, 5-second read timeout) plus a per-key in-flight cap (8 concurrent requests per key by default) before signature verification.
CLI
voicecall commands
delegate to the Gateway-owned voice-call runtime so the CLI does not bind a
second webhook server. If no Gateway is reachable, the commands fall back to
a standalone CLI runtime.
latency reads calls.jsonl from the default voice-call storage path. Use
--file <path> to point at a different log and --last <n> to limit
analysis to the last N records (default 200). Output includes min/max/avg,
p50, and p95 for turn latency and listen-wait times.
Agent tool
Tool name:voice_call.
| Action | Args |
|---|---|
initiate_call | message, to?, mode?, dtmfSequence? |
continue_call | callId, message |
speak_to_user | callId, message |
send_dtmf | callId, digits |
end_call | callId |
get_status | callId |
Gateway RPC
| Method | Args | Notes |
|---|---|---|
voicecall.initiate | to?, message, mode?, sessionKey?, requesterSessionKey? | Falls back to toNumber config when to is omitted. |
voicecall.start | to, message?, mode?, dtmfSequence?, sessionKey? | Same as initiate but also accepts pre-connect dtmfSequence. |
voicecall.continue | callId, message | Blocks until the turn resolves; returns the transcript. |
voicecall.continue.start | callId, message | Async variant: returns an operationId immediately. |
voicecall.continue.result | operationId | Polls a pending voicecall.continue.start operation for its result. |
voicecall.speak | callId, message | Speaks without waiting; uses the realtime bridge when realtime.enabled. |
voicecall.dtmf | callId, digits | |
voicecall.end | callId | |
voicecall.status | callId? | Omit callId to list all active calls. |
dtmfSequence is only valid with mode: "conversation"; notify-mode calls
should use voicecall.dtmf after the call exists if they need post-connect
digits.
Troubleshooting
Setup fails webhook exposure
Run setup from the same environment that runs the Gateway:twilio, telnyx, and plivo, webhook-exposure must be green. A
configured publicUrl still fails when it points at local or private
network space, because the carrier cannot call back into those addresses.
Do not use localhost, 127.0.0.1, 0.0.0.0, 10.x, 172.16.x-172.31.x,
192.168.x, 169.254.x, fc00::/7, fd00::/8, or other carrier-grade-NAT
ranges as publicUrl.
Twilio notify-mode outbound calls send their initial <Say> TwiML directly
in the create-call request, so the first spoken message does not depend on
Twilio fetching webhook TwiML. A public webhook is still required for status
callbacks, conversation calls, pre-connect DTMF, realtime streams, and
post-connect call control.
Use one public exposure path:
voicecall smoke is a dry run unless you pass --yes.
Provider credentials fail
Check the selected provider and the required credential fields:- Twilio:
twilio.accountSid,twilio.authToken, andfromNumber, orTWILIO_ACCOUNT_SID,TWILIO_AUTH_TOKEN, andTWILIO_FROM_NUMBER. - Telnyx:
telnyx.apiKey,telnyx.connectionId,telnyx.publicKey, andfromNumber, orTELNYX_API_KEY,TELNYX_CONNECTION_ID, andTELNYX_PUBLIC_KEY. - Plivo:
plivo.authId,plivo.authToken, andfromNumber, orPLIVO_AUTH_IDandPLIVO_AUTH_TOKEN.
Calls start but provider webhooks do not arrive
Confirm the provider console points at the exact public webhook URL:publicUrlpoints at a different path thanserve.path.- The tunnel URL changed after the Gateway started.
- A proxy forwards the request but strips or rewrites host/proto headers.
- Firewall or DNS routes the public hostname somewhere other than the Gateway.
- The Gateway was restarted without the Voice Call plugin enabled.
webhookSecurity.allowedHosts to the public hostname, or use
webhookSecurity.trustedProxyIPs for a known proxy address. Use
webhookSecurity.trustForwardingHeaders only when the proxy boundary is
under your control.
Signature verification fails
Provider signatures are checked against the public URL OpenClaw reconstructs from the incoming request. If signatures fail:- Confirm the provider webhook URL exactly matches
publicUrl, including scheme, host, and path. - For ngrok free-tier URLs, update
publicUrlwhen the tunnel hostname changes. - Ensure the proxy preserves the original host and proto headers, or configure
webhookSecurity.allowedHosts. - Do not enable
skipSignatureVerificationoutside local testing.
Google Meet Twilio joins fail
Google Meet uses this plugin for Twilio dial-in joins. First verify Voice Call:--dtmf-sequence. The phone call can be healthy
while the meeting rejects or ignores an incorrect DTMF sequence.
Google Meet starts the Twilio phone leg through voicecall.start with a
pre-connect DTMF sequence. PIN-derived sequences include the Google Meet
plugin’s voiceCall.dtmfDelayMs (default 12000 ms) as leading Twilio
wait digits, because Meet dial-in prompts can arrive late. Voice Call then
redirects back to realtime handling before the intro greeting is requested.
Use openclaw logs --follow for the live phase trace. A healthy Twilio Meet
join logs this order:
- Google Meet delegates the Twilio join to Voice Call.
- Voice Call stores pre-connect DTMF TwiML.
- Twilio initial TwiML is consumed and served before realtime handling.
- Voice Call serves realtime TwiML for the Twilio call.
- Google Meet requests intro speech with
voicecall.speakafter the post-DTMF delay.
openclaw voicecall tail still shows persisted call records; useful for
call state and transcripts, but not every webhook/realtime transition
appears there.
Realtime call has no speech
Confirm only one audio mode is enabled:realtime.enabled and
streaming.enabled cannot both be true.
For realtime Twilio/Telnyx calls, also verify:
- A realtime provider plugin is loaded and registered.
realtime.provideris unset or names a registered provider.- The provider API key is available to the Gateway process.
openclaw logs --followshows realtime TwiML served, the realtime bridge started, and the initial greeting queued.