EnableX Voice API is a one-stop solution for making, receiving, and monitoring calls around the world. EnableX voice API provides easy-to-implement APIs that can embed Voice-over-IP (VoIP), PSTN, and SIP calling directly into your app, browser, or AI chatbots in your preferred programming language. 

EnableX Voice API enables developers to implement the following voice-based capabilities in their applications: 

  • Make, receive, or bridge calls  
  • Play IVR over IP/PSTN
  • Route voice calls to phones, browsers, and mobile applications 

EnableX provides REST APIs to: 

  • Make a call 
  • Accept/reject an incoming call 
  • Modify a call-in-progress 
  • Query the details of ongoing calls

The communication from the Enablex platform to the voice application takes place through the secure webHook provided with the REST API or configured from the portal as part of the subscribed voice services.  

How to integrate EnableX Voice Services in your application 

Create a voice project and provision EnableX virtual number

  1. Create a free trial account on EnableX 
  2. Create Project: Login to Portal and create project with voice service.
  3. Get API Access Credentials: The API access credentials are required to access Voice REST API Service which authorizes applications to communicate with EnableX server.
  4. Configure Voice Service: To use any voice service (inbound or outbound), a phone number and a voice prompt need to be associated with your project. 
    • Phone Number: Can be a shared or a dedicated number.
    • Voice Prompts: You can use pre-configured/recorded prompts, or leverage the advanced Text-To-Speech engine provided by EnableX to play prompts dynamically. 

Refer to How to Create Voice Project for more details.  

Use API access credentials to make REST API calls 

Each REST API call to access voice services is validated via the HTTP Basic Authentication Header. The APP_ID and APP_KEY as received above serve as the access credentials as shown below: 

  • Application ID or APP_ID as username
  • Application Key or APP_KEY as Password
POST https://api.enablex.io/voice/v1/call 
Authorization: Basic XXXXX // where XXXXX is a base64 encoded string of APP_ID:APP_KEY 
Content-Type: application/json

Secure Webhook for Callbacks 

Webhooks are the asynchronous callbacks posted by the server upon completion of a certain request made by the client. The result of the request is stored in the response body. As these Webhooks are public URLs exposed on the application server to the public network, it is imperative to encrypt them. 

EnableX adopts the following measures to secure (inbound/outbound) Webhooks: 

  • The server sends Webhook events with a payload encrypted using APP_ID and supporting headers depending upon the encoding/format type. 
  • These supporting headers like x-algorithm, x-encoding, and x-format along with the APP_ID are then used by the client to decrypt the message using the same values as the server for encryption.   

Receive Voice Calls

An inbound voice call requires you to configure a Webhook URL and prompt/text to get the event notification and play the prompt/text. 

EnableX provides a set of predefined prompts that can be readily used by the subscriber or the user can upload customized prompts as an “mp3”, “.wav” file. 

Refer to How to add voice prompt for more details. 

The occurrence of an incoming call triggers the following events via the Webhook: 

  • The Webhook event provides an auto-generated voice_Id that is a unique identifier for the voice call and is referenced to execute any subsequent APIs on the voice call like accept call/hold call/disconnect call etc.  
  • The user application can either accept the incoming call by calling dialer.acceptCall(voice_id) or reject the incoming call by calling dialer.rejectCall(voice_id)
Webhook notification by Voice Server for an incoming call
{
      voice_id : // Unique Voice ID generated by the voice server for each Call
      state : “incoming call”
      from : // Calling Number
      to : // EnableX CLI
      channel_id : // Call Leg Channel ID
      timestamp : 2021-02-18T12:47-00Z
}
Accept Call API Request

https://api.enablex.io/voice/v1/call/$voice_id/accept

PUT https://api.enablex.io/voice/v1/call/$voiceid/accept
Authorization: Basic XXXXXX
Content-Type: application/json

Make Voice Calls 

You can make an outbound call using the EnableX virtual number as CLI (Caller Line Identity). 

Outbound Call API Request

https://api.enablex.io/voice/v1/call

POST https://api.enablex.io/voice/v1/call
Authorization: Basic XXXXXX
Content-Type: application/json
{
      name : ”Service Name”,
      from : “EnableX Number”, // Caller Line Identity
      to : “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 for any call state changes or play state changes based on which the application can take further action to either bridge a call to another number, play Interactive voice menu to users, join the audio call to a video room, or join a conference. 

Webhook Notification from Voice Server for Call State Change 
{ 
       voice_id : // Unique Voice ID generated by voice server for each Call 
       state : “ringing” || “connected” || “disconnected” 
       from : // Calling Number  
       to : // EnableX CLI 
       channel_id : // Call Leg Channel ID 
       timestamp : 2021-02-18T12:47-00Z 
} 
Webhook Notification from Voice Server for Play State Change
{ 
       voice_id : // Unique Voice ID generated by voice server for each Call 
       play_id : // unique play id for the prompt / text played. 
       playstate : “initiated” || “playfinished” || “error” 
       from : //Calling Number  
       to : //EnableX CLI 
       channel_id : // Call Leg Channel ID 
       timestamp : 2021-02-18T12:47-00Z 
} 

Interactive Voice Response

You can build an IVR application to collect feedback and respond to customer inquiries or route calls to the right person with multi-level IVR. User inputs can be accepted either through traditional DTMF or through voice response which works based on Automatic Speech Recognition.

Refer to How to add voice prompt for more details. 

The EnableX voice server supports the collection of input digits from the user and notifies the application via Webhook to take further action based on the input digits by the user. 

Voice API for IVR menu

https://voice/v1/call/$voice_id/play

POST https://api.enablex.io/voice/v1/call/$voice_id/play 
Authorization: Basic XXXXXX  
Content-Type: application/json 
{ 
         text : “Text to be played” 
         voice : “male || female” 
         language : “en-US” // language prompt to be played 
         prompt_ref : //optional prompt reference for further processing  
         // User Response by digits  
         dtmf : true // optional 
         or 
         //User Response by voice Command 
         asr : true 
         start_timeout : 10 // initial timeout before user starts speaking 
         recognizer_timeout : 2 // wait timer before speech recognizer returns result 
} 
Or 
{ 
         prompt_name : //prompt name to be played  
         prompt_ref : //optional prompt reference for further processing 
         // User Response by dtmf digits 
         dtmf : true  
         or  
         //User Response by voice Command 
         asr : true 
         start_timeout : 10 // initial timeout before user starts speaking 
         recognizer_timeout : 2 // wait timer before speech recognizer returns result 
} 
The collection of input digits by the voice server and notification sent to the application via webHook URL 
{ 
     voice_id : // Unique Voice ID generated by voice server for each Call 
     play_id : // unique play id for the prompt / text played. 
     playstate : “digitcollected” 
     digits : “12345” // digits collected from user. 
     from : //Calling Number  
     to : //EnableX CLI 
     timestamp : 2021-02-18T12:47-00Z 
} 

Voice Bridge

You can bridge an inbound/outbound voice call to a PSTN/VOIP/SIP-enabled device by utilizing connectVoice() API.

Connect API request 

https://api.enablex.io/voice/call/$voice_id/connect

PUT https://api.enablex.io/voice/v1/call/$voice_id/connect 
Authorization: Basic XXXXXX  
Content-Type: application/json 
{ 
     from : // EnableX virtual number 
     to : //Destination number for bridge call 
}  

EnableX SIP/PSTN Integration

EnableX allows users to join a video room using mobile phones without internet, a landline, or office desk phones by utilizing Voice API to bridge an inbound/outbound voice call from any network to the Video Room.

The Voice API provides the following ways to join a voice call to the video room: 

  • Make an Inbound Call to Video Room using Room pin

The user can make an inbound call to an EnableX number with a video service subscription and join the video room by entering the room pin. 

  • Initiate an Outbound Call and join Video Room when the call is connected 
Voice API request to initiate a Call and Join Room

https://api.enablex.io/voice/v1/room/$room_id/join

POST https://api.enablex.io/voice/v1/room/$room_id/join 
Authorization: Basic XXXXXX  
Content-Type: application/json 
{ 
          Name : // Application Name 
          from : // EnableX virtual number 
          to : //Destination number  
          event_url : // webHook event URL for call back 
} 

 

  • Join an Ongoing Inbound/Outbound Voice Call to Video Room 
Voice API to join an existing inbound/outbound call to video room 

https://api.enablex.io/voice/v1/room/$room_id/call/$voice_id/join

PUT https://api.enablex.io/voice/v1/room/$room_id/call/$voice_id/join 
Authorization: Basic XXXXXX  
Content-Type: application/json 

The Join Room API allows enterprises to set up a low-cost web-based agent/call distribution system or a contact center application where all the agents can log into a video room via a web interface. The application can bridge an inbound/outbound call between the user and agents using Join Room API.  

Voice Broadcast

Voice Message Broadcast allows you to send voice messages to the masses. The EnableX message broadcast is enriched with the following advanced features: 

  • The answering machine detection system helps to find out if the call was picked up by a person or an answering machine. 
  • Customize the next action based on whether the call was answered by a person or an answering machine. 
  • Create a personalized telephone poll and gather user inputs using traditional DTMF or voice that gets converted into data by EnableX Automatic Speech Recognition System. 
  • Each call in the broadcast gets a separate handle through Webhook events which can be used to control every call individually. This can be used to play IVR, bridge calls, or use the Advance Call Control system. 
  • The application has multiple options to communicate with users. The application can send messages through pre-recorded prompt or send high-quality recording using Text–To–Speech and collect user input through traditional DTMF or voice that gets converted into data by EnableX Automatic Speech Recognition system and then processed for further action. 
Message BroadCast API 

https://api.enablex.io/voice/v1/broadcast

POST https://api.enablex.io/voice/v1/broadcast 
Authorization: Basic XXXXXX  
Content-Type: application/json
{ 
    "name": "Broadcat_Application", 
    "owner_ref": "XYZ", 
    "from": "EnableX virtual numbers", 
    "auto_record": false, 
    "broadcastnumbersjson": [ 
     { 
         "phone": 919999911111 
     }, 
     { 
         “phone”: 919999922222  
     }, 
     {  
         “phone”: 919999933333 
     } 
 ], 
 "action_on_connect": { 
     "play": { 
     //Play using text to speech 
     "text": "This is testing", 
     "language": "en-US", 
     "voice": "Male", 
     Or 
     //Play pre recorded file that can be uploaded from enablex portal 
     "prompt_name": "prompt_name", 
     "interrupt": false, 
     "dtmf" : true //optional parameter , user input through traditional dtmf 
     Or  
     “asr” : true // optional parameter , user input through voice. 
   } 
 }, 
"call_param": { 
    "IntervalBetweenRetries": 5, 
    "NumberOfRetries": 3 
  } 
} 

Text To Speech

Text To Speech (TTS) also known as Speech Synthesis is a process where text is converted into a human-sounding voice. EnableX provides options to play TTS prompt in a gender-specific voice and various languages. You can provide text dynamically depending on the situation and configure the prompt with the above-mentioned options.  

Uses:
  • Building an IVR or other voice applications without spending much time recording each prompt in a human voice. The ability to dynamically generate TTS prompts from raw text saves a lot of development time and effort.  
  • Building Voice Bots powered with Artificial Intelligence that can communicate with users using TTS and understand the user’s speech using Automatic Speech Recognition.   
  • Building applications for people with a learning disability, visual impairment, or literacy challenge thus providing equal access to information.  

The input text for the prompt along with the voice and language selection can be either passed to the New Call API for an inbound call as configured on the portal or passed to the Play command for IVR.  

{ 
         text : // Text to be played 
         voice : male | female 
         language : // language in which the TTS prompt is to be played 
} 

Automatic Speech Recognition

Automatic Speech Recognition allows humans to verbally communicate with a computer interface. The computers can detect patterns in audio wave forms, match them with the sounds in a given language, and identify the speech into words.  

Uses:
  • Training and building Voice Bots powered with AI by utilizing ASS combined with natural language understanding. This allows users to verbally communicate with an IVR system. 
  • Building broadcasting applications like elaborate polls, questionnaires, online surveys, etc., where users can provide verbal inputs to the ASS.  

Advance Call Control

EnableX Advance call control APIs allow you to hold/resume, transfer, and forward a call. This feature is particularly useful in contact/support centers where the inbound/outbound call can be transferred or forwarded to another agent/attendant.  

Voice API to hold/resume the call

https://api.enablex.io/voice/v1/call/$voice_id/hold 

PUT https://api.enablex.io/voice/v1/call/voice_id/hold 
Authorization: Basic XXXXXX  
Content-Type: application/json 
{ 
    Hold : true | false // true – call hold , false – call resume 
}
Voice API to transfer an ongoing call

https://api.enablex.io/voice/v1/call/{callId}/transfer 

PUT https://api.enablex.io/voice/v1/call/voice_id/transfer 
Authorization: Basic XXXXXX  
Content-Type: application/json 
{ 
    from : // EnableX number 
    transfer_to : 919999922222  
} 
Voice API to forward an ongoing call 

https://api.enablex.io/voice/v1/call/{callId}/forward

PUT https://api.enablex.io/voice/v1/call/voice_id/forward 
Authorization: Basic XXXXXX  
Content-Type: application/json
{ 
    from : //enablex number 
    to : 919999933333 
} 

Conference 

EnableX Conference API allows you to create a conference or add inbound/outbound calls to an existing conference. 

Conference API to create an outbound conference

https://api.enablex.io/voice/v1/conference

POST https://api.enablex.io/voice/v1/conference 
Authorization: Basic XXXXXX  
Content-Type: application/json 
{ 
       name : conference app name 
       from : EnableX number 
       to : destination number 
       event_url : // webHook URL for event call back  
} 
Conference API to create an Outbound Call and join an existing conference 
PUT https://api.enablex.io/voice/v1/conference/$conference_id 
Authorization: Basic XXXXXX  
Content-Type: application/json 
{ 
    from : EnableX number 
    to : destination number 
} 
Conference API to accept an incoming call and create an inbound conference
 
POST https://api.enablex.io/voice/v1/conference/$voice_id 
Authorization: Basic XXXXXX  
Content-Type: application/json 
Conference API to accept an incoming call and join an existing conference 
PUT https://api.enablex.io/voice/v1/conference/$voice_id/$conference_id 
Authorization: Basic XXXXXX  
Content-Type: application/json Call Recording is another useful feature provided by EnableX voice service. You can utilize EnableX voice APIs to start/stop/retrieve a recording. The recordings are encrypted for security reasons and their storage location can be configured by the developer.

Recording

Call Recording is another useful feature provided by EnableX voice service. You can utilize EnableX voice APIs to start/stop/retrieve a recording. The recordings are encrypted for security reasons and their storage location can be configured by the developer.

Recording API to start/stop recording of a bridged call

https://api.enablex.io/v1/call/voice_id/recording

{ 
     "start": true, 
     "stop": true, 
     "recording_name": "my_recording.wav" //Optional Parameter
} 
Recording API to retrieve a record

https://api.enablex.io/voice/v1/recording/:serviceId/:recordingId