*** title: Overview subtitle: How to initiate Voice AI calls from VoxEngine ------------------------------------------------------- Outbound calling means your scenario starts the call to the destination. ## Call flow 1. Start the outbound routing rule manually (Control Panel) or via Management API `startScenarios`. 2. Read `destination` and `callerId` from `VoxEngine.customData()`. 3. Place an outbound leg (`callPSTN`, `callSIP`, `callUser`, or `callWhatsappUser`). 4. After `CallEvents.Connected`, create the connector client and bridge audio. 5. Apply barge-in, logging, and termination handlers. ```js title="Outbound Voice AI skeleton" require(Modules.OpenAI); require(Modules.ApplicationStorage); VoxEngine.addEventListener(AppEvents.Started, () => { const { destination, callerId } = JSON.parse(VoxEngine.customData() || "{}"); const call = VoxEngine.callPSTN(destination, callerId); call.addEventListener(CallEvents.Connected, async () => { const apiKey = (await ApplicationStorage.get("OPENAI_API_KEY")).value; const voiceAIClient = OpenAI.createRealtimeAPIClient({ apiKey, model: "your-realtime-model" }); VoxEngine.sendMediaBetween(call, voiceAIClient); }); }); ``` ## Voice AI checklist for outbound scenarios * Validate required custom data (`destination`, `callerId`) and fail fast if missing. * Only create and bridge the connector after the callee answers. * Add a demo timeout (`setTimeout(() => call.hangup(), ...)`) for predictable tests. * Clear connector output on user speech start for barge-in. * Log call failures with destination and channel. ## Destination options * [Phone numbers](guides-outbound-call-basics-phone-numbers) * [WhatsApp](guides-outbound-call-basics-whatsapp) * [SIP](guides-outbound-call-basics-sip) * [App users](guides-outbound-call-basics-app-users) - New screenshot: Running an outbound routing rule with custom JSON in Control Panel.