Example: Function calling
This example answers an inbound Voximplant call, connects it to ElevenLabs Agents, and handles client-side tool calls inside VoxEngine.
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
- App 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 (phone number / WhatsApp / SIP username / app user alias) to this scenario: https://voximplant.com/docs/getting-started/basic-concepts/routing-rules
- Store your ElevenLabs API key in Voximplant
ApplicationStorageunderELEVENLABS_API_KEY. - Store your ElevenLabs Agent ID in Voximplant
ApplicationStorageunderELEVENLABS_AGENT_ID. - Configure a client tool in your ElevenLabs Agent named
get_weatherthat expects alocationparameter.
Tool handling
ElevenLabs Agents send tool requests via ElevenLabs.AgentsEvents.ClientToolCall. The example extracts the tool name and parameters, runs a stub implementation, and sends the result back using clientToolResult:
Tool handling
Barge-in
Barge-in
Notes
See the VoxEngine API Reference for more details.
Full VoxEngine scenario
voxeengine-elevenlabs-tool-call.js