Example: Placing an outbound call
This example starts a VoxEngine session, places an outbound PSTN call, and bridges audio to OpenAI Realtime once the callee answers.
Jump to the Full VoxEngine scenario.
Prerequisites
- Store your OpenAI API key in Voximplant
ApplicationStorageunderOPENAI_API_KEY. - Ensure outbound calling is enabled for your Voximplant application and that your caller ID is verified.
Outbound call parameters
The example expects destination and caller ID in customData (read via VoxEngine.customData()):
Custom data example
Launch the routing rule
For quick testing, you can start this outbound scenario from the Voximplant Control Panel:
- Open your Voximplant application and go to the Routing tab.
- Select the routing rule that has this scenario attached.
- Click Run.
- Provide Custom data (max 200 bytes) with
destinationandcallerId:
Custom data example
For production, start the routing rule via Management API startScenarios (pass rule_id, and pass the same JSON string in script_custom_data): https://voximplant.com/docs/references/httpapi/scenarios#startscenarios
Connect call audio
After the callee answers, the example bridges audio both ways:
Connect call audio
Barge-in
Barge-in
Notes
See the VoxEngine API Reference for more details.
Full VoxEngine scenario
voxeengine-openai-place-outbound-call.js