Outbound calls
Outbound flows start when you trigger a routing rule manually (Control Panel) or through the Management API (startScenarios).
VoxEngine then starts AppEvents.Started.
Outbound Voice AI pattern
Outbound calls have different methods depending on the destination channel (PSTN, SIP, WhatsApp, app user),
but the overall pattern is similar: trigger the call, listen for CallEvents.Connected, then set up the Voice AI client and media bridging.
The call methods require a callerId. For phone numbers this must be a verified caller ID or a purchased Voximplant number.
For WhatsApp, this must be a verified WhatsApp Business number.
Start the outbound flow
Choose one of these options:
Start from the GUI (Control Panel)
In manage.voximplant.com, open your application, go to Routing, choose the rule that points to your outbound scenario, then start it with script_custom_data that includes destination and caller ID.
Start from CLI (Management API)
Use curl to call StartScenarios and pass the same script_custom_data JSON payload from your terminal.
If using the management API via curl or one of the management API Clients,
you will need to configure an API key
and create an authorization token.
Outbound checklist
- Listen for the
AppEvents.Startedentry point - Use
VoxEngine.customData()to retrieve any information needed for the scenario, such as destination and caller ID to use - Place the channel-specific call using one of the call methods (
callPSTN,callUser,callSIP,callWhatsappUser) - Listen for key call events (
Disconnected,Failed, etc.) and handle as needed - Create the Voice AI connector after
CallEvents.Connected - Bridge media between call and connector:
- Use
VoxEngine.sendMediaBetween(...)for simple two-party bridging - Alternatively use
call.sendMediaTo(...)andconnector.sendMediaTo(...)for more complex pipelines
- Use
- Invoke methods and handle events from the connector to drive your Voice AI logic