Example: Answering an incoming call
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:
- Phone number: https://voximplant.com/docs/getting-started/basic-concepts/phone-numbers
- WhatsApp: https://voximplant.com/docs/guides/integrations/whatsapp
- SIP user / SIP registration: https://voximplant.com/docs/guides/calls/sip
- Voximplant user: https://voximplant.com/docs/getting-started/basic-concepts/users
- Create a routing rule that points the destination to this scenario: https://voximplant.com/docs/getting-started/basic-concepts/routing-rules
- Store your Cartesia API key in Voximplant
ApplicationStorageunderCARTESIA_API_KEY - Store your Cartesia Agent ID in Voximplant
ApplicationStorageunderCARTESIA_AGENT_ID
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