語音通話(外掛程式)
透過外掛程式為 OpenClaw 進行語音通話。支援出站通知和具有入站原則的多回合對話。 目前的提供商:twilio(Programmable Voice + Media Streams)telnyx(Call Control v2)plivo(Voice API + XML transfer + GetInput speech)mock(dev/無網路)
- 安裝外掛程式
- 重新啟動 Gateway
- 在
plugins.entries.voice-call.config下設定 - 使用
openclaw voicecall ...或voice_call工具
執行位置(本地 vs 遠端)
語音通話外掛程式在 Gateway 進程內執行。 如果使用遠端 Gateway,請在執行 Gateway 的機器上安裝/設定外掛程式,然後重新啟動 Gateway 以載入它。安裝
選項 A:從 npm 安裝(建議)
選項 B:從本地資料夾安裝(開發,無複製)
Config
Set config underplugins.entries.voice-call.config:
- Twilio/Telnyx require a publicly reachable webhook URL.
- Plivo requires 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.- If you use 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). Use for local dev only.- Ngrok free tier URLs can change or add interstitial behavior; if
publicUrldrifts, Twilio signatures will fail. For production, prefer a stable domain or Tailscale funnel. - Streaming security defaults:
streaming.preStartTimeoutMscloses sockets that never send a validstartframe.streaming.maxPendingConnectionscaps total unauthenticated pre-start sockets.streaming.maxPendingConnectionsPerIpcaps unauthenticated pre-start sockets per source IP.streaming.maxConnectionscaps total open media stream sockets (pending + active).
Stale call reaper
UsestaleCallReaperSeconds to end calls that never receive a terminal webhook
(for example, notify-mode calls that never complete). The default is 0
(disabled).
Recommended ranges:
- Production:
120–300seconds for notify-style flows. - Keep this value higher than
maxDurationSecondsso normal calls can finish. A good starting point ismaxDurationSeconds + 30–60seconds.
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.webhookSecurity.allowedHosts allowlists hosts from forwarding headers.
webhookSecurity.trustForwardingHeaders trusts forwarded headers without an allowlist.
webhookSecurity.trustedProxyIPs only trusts forwarded headers when the request
remote IP matches the list.
Webhook replay protection is enabled for Twilio 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.
Example with a stable public host:
TTS for calls
Voice Call uses the coremessages.tts configuration (OpenAI or ElevenLabs) for
streaming speech on calls. You can override it under the plugin config with the
same shape — it deep‑merges with messages.tts.
- Edge TTS is ignored for voice calls (telephony audio needs PCM; Edge output is unreliable).
- Core TTS is used when Twilio media streaming is enabled; otherwise calls fall back to provider native voices.
More examples
Use core TTS only (no override):Inbound calls
Inbound policy defaults todisabled. To enable inbound calls, set:
responseModelresponseSystemPromptresponseTimeoutMs
CLI
Agent tool
Tool name:voice_call
Actions:
initiate_call(message, to?, mode?)continue_call(callId, message)speak_to_user(callId, message)end_call(callId)get_status(callId)
skills/voice-call/SKILL.md.
Gateway RPC
voicecall.initiate(to?,message,mode?)voicecall.continue(callId,message)voicecall.speak(callId,message)voicecall.end(callId)voicecall.status(callId)