Example: Answering an incoming call
Example: Answering an incoming call
For the complete documentation index, see llms.txt.
This example answers an inbound Voximplant call and bridges audio to Cartesia Line Agents for real-time speech-to-speech conversations.
Jump to the Full VoxEngine scenario.
Prerequisites
- Set up an inbound entrypoint for the caller:
- Create a routing rule that points the destination (phone number / WhatsApp / SIP username / app user alias) to this scenario.
- Store your Cartesia API key in Voximplant Secrets under
CARTESIA_API_KEY - Store your Cartesia Agent ID in Voximplant
ApplicationStorageunderCARTESIA_AGENT_ID(the agent ID is not sensitive, so it can live in key-value storage)
Session setup
Create a Cartesia.AgentsClient with your API key, API version, and agent ID:
Create Cartesia client
After client creation, send a start event with optional metadata:
Start session
Events
The example logs key lifecycle and debugging events:
Events (example from the scenario)
Notes
See the VoxEngine API Reference for more details.
Full VoxEngine scenario
voxeengine-cartesia-inbound.js