Making calls
Place and receive calls over PSTN, SIP, and WebRTC. Bring your own telephony provider or let Wordcab originate the leg.
Wordcab agents handle outbound and inbound calls over PSTN, SIP, and WebRTC. The media path is flexible: Wordcab can originate the leg itself, or you can bring your own telephony provider (Twilio, Telnyx, Plivo, Zoom, a SIP trunk).
Outbound calls
call = client.agents.calls.create(
agent_id="agent_abc",
phone_number="+14155551234",
context={
"customer_name": "Jane Doe",
"appointment_time": "2:00 PM",
"purpose": "appointment_reminder",
},
max_duration=300, # seconds
record=True,
idempotency_key="reminder-2026-04-16-user-55123",
)Call lifecycle
initiating— call object created, media leg coming up.ringing— PSTN ringing the far side.in_progress— answered; agent is running.completed— both sides hung up normally.failed— technical error. Seecall.error.no_answer— rang through without being picked up.
Inbound calls
Provision a number (from Wordcab, or from your own provider) and associate it with an agent. Incoming calls to that number route to the agent automatically.
client.agents.update(
agent_id="agent_abc",
phone_numbers=["+14155559999"],
)Twilio media streams
Bridge Twilio calls into a Wordcab agent with TwiML <Stream>. Your Twilio webhook returns:
<Response>
<Connect>
<Stream url="wss://api.wordcab.com/v1/media/twilio?agent_id=agent_abc" />
</Connect>
</Response>Wordcab receives the audio over WebSocket (μ-law @ 8 kHz), runs STT → LLM → TTS, and writes back audio frames in the same stream.
SIP
For on-prem PBX (Avaya, Genesys, Cisco, FreeSWITCH), deploy Wordcab's SIP gateway into your network. It speaks standard SIP + RTP and terminates TLS/SRTP where required.
helm install wordcab-sip wordcab/sip-gateway \\
--set trunk.host=pbx.internal.example.com \\
--set trunk.codec=g711a \\
--set agents.defaultId=agent_abcRecordings
When record=True, the full call audio is stored in the configured object store. The retention window (default 30 days on cloud, configurable on self-hosted) is set per deployment.
call = client.calls.get("call_abc123")
if call.recording_url:
audio = client.calls.download_recording(call.id)
with open("call.wav", "wb") as f:
f.write(audio)Recording consent rules vary by jurisdiction. Two-party-consent states, HIPAA contexts, and regulated industries each have different requirements. Wordcab does not decide this for you — configure your agent's opening line and your retention policy to match your compliance posture.