Example: Answering an incoming call
This example answers an inbound Voximplant call and bridges audio to OpenAI Realtime for 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 (see also https://voximplant.com/docs/guides/calls/scenarios#how-to-call-a-voximplant-user)
- Create a routing rule that points the destination (number / WhatsApp / SIP username) to this scenario: https://voximplant.com/docs/getting-started/basic-concepts/routing-rules
- Store your OpenAI API key in Voximplant
ApplicationStorageunderOPENAI_API_KEY.
Session setup
The example configures the OpenAI Realtime session with a short system prompt, a voice, and server VAD:
Session setup
Connect call audio
Once the session is ready, bridge audio both ways between the call and OpenAI:
Connect call audio
Barge-in
Barge-in
Notes
See the VoxEngine API Reference for more details.
Full VoxEngine scenario
voxeengine-openai-answer-incoming-call.js