Make an Outbound Voice Call
You must configure or select the outbound phone number to which you want to make a call. The selected number is placed as a CLI (Caller Line Identity). The CLI provided in the Voice API calls (by the application developer) is validated against the configured number. If the number does not match, the call will fail.
Test with Open API Tool
You can quickly test the outbound call using the OpenAPI page. To try it out, click Open API.
Authenticate
For real execution, click Authenticate and enter the following credentials:
- Username: APP_ID
- Password: APP_Key
Click Try it Out, update the From: JSON field with your configured outbound phone number and To: with the desired destination number and click Execute. The outbound call is initiated and the progress and the status of the call is shown in the response window.
Use API for Voice Call
You can make an outbound call using the EnableX virtual number as CLI (Caller Line Identity).
POST https://api.enablex.io/voice/v1/callAuthorization: Basic XXXXXXContent-Type: application/json{name : "Service Name",from : "EnableX Number", // Caller Line Identityto : "Destination Number","action_on_connect" : {//Play Text To Speech to the User once call is connected"play" : {"text" : "Hi Good Morning ! Welcome to EnableX","voice" : "female","language" : "en-US","prompt_ref" : "prompt reference for further processing"}Or"play" : {"prompt_name" : // file / prompt name to be played once the call is connected"prompt_ref" : "reference parameter for further processing"}},"event_url" : "webHook URL for Call Backs"}
Both outbound and inbound calls receive notification about any call state changes or play state changes based on which the application can take further action to either bridge the call to another number, play interactive voice menu to users, join the audio call with a video room, or join it with a conference.
Below is a sample webhook notification from the voice server when the call state changes.
{voice_id : // Unique Voice ID generated by voice server for each Callstate : "ringing" || "connected" || "disconnected"from : // Calling Numberto : // EnableX CLIchannel_id : // Call Leg Channel IDtimestamp : 2021-02-18T12:47-00Z}
Below is a sample webhook notification from the voice server when the play state changes.
{voice_id : // Unique Voice ID generated by voice server for each Callplay_id : // unique play id for the prompt / text played.playstate : "initiated" || "playfinished" || "error"from : //Calling Numberto : //EnableX CLIchannel_id : // Call Leg Channel IDtimestamp : 2021-02-18T12:47-00Z}