EnableX Voice Service handles both Inbound and Outbound Voice Calls. Inbound Voice Call are processed through pre-configured WebHook URL to accept call, play Tones / Voice Prompts and make onward call to Bridge. On the other hand, Outbound Voice Calls are originated through Rest API Service and handled through pre-configured WebHook URL called by Voice Services to notify progress/status, etc.
Receive Incoming Call
Inbound Voice Service needs to be configured for your Project through EnableX Portal. Follow the detailed Guidelines given in the Get Started page to configure the following:
A Phone Number to receive Inbound Voice Call
Voice Prompt (Optional) – If not configured, default prompts would be played
WebHook to process Inbound Voice Call
If you have chosen a shared incoming call, you will get a PIN displayed along with the assigned phone number. This PIN will be used for receiving a call and once the caller dials the PIN, call will be routed to your application.
Handle Incoming Call Events
Incoming call is always accepted by the Voice service. If the incoming number is dedicated, the prompt configured for the incoming numbers will be played and then the control will be handed over to the program using configured webhook event. If the incoming number is shared, an additional system generated IVR will be played to query the PIN before the call is routed to the configured application.
In case if the greeting is configured, the greetings will be played by the system. Once the play is complete, a Webhook will be invoked for further processing.
voice_id of the incoming call. This identification shall be used for all further requests to the server.
Incoming call: The webhook notification is set to call as soon as the incoming call comes, the call can be rejected through API. This state will be invoked if there is no default greeting configured
Originating phone number – also known as Caller Id
The number to which the call is received, the Phone number assigned to voice service for the project.
Timestamp at which the call is received
Dial Out a Number
This service makes an outbound call to the destination number.
The CLI (Caller Line Identification) of the number you have rented (shared or dedicated) for the outbound call is expected to be passed by the developer, as a parameter to the API. The number passed by the developer will be matched against the provisioned number. If there is any mismatch, the outbound call will fail.
Free data field that will be returned as-is in response to an event. It can be used as means to co-relate requests and responses.
Recording by default or on command
The CLI assigned on the outbound number. This number is matched with the configured number.
If set, prompt will be played automatically when destination number is connected
Specifies the action to perform when an outbound call is connected. Action, could either be to connect the cal or to bridge the call with one more participant or play voice prompt or voice menu
Plays the prompt that has been uploaded with Prompt Id through portal provisioning
TTS to play the prompt according to the parameter defined as following parameters below
The preferred spoken language for TTS
Conditional, if text is supported
Conditional. Need to be there if “text” is present.
Webhook URL to be called for the application to take control
Response: Immediate response will be generated from the server as a response to the REST request. REST response code would represent if the call was successful along with the JSON body.
“state: “initiated”, // Reason code if failed ; else success
“owner_ref”: // User defined Id
Voice Call Identifier
Textual description of the reason code
Free data passed during the request
UTC timestamp at which the response was generated
Error Response: All error responses will follow the standard HTTP error format and error code. The JSON body of the response will highlight exact error that occurred and it’s description. Please see Error codes here.
Error Response Example:
"msg": "description of the error",
Events: Events will be triggered by the system will be called using the webHooks provided by the API
"voice_id": "f1aa71c0-8f2a-4fe8-b5ef-9a330454ef58", // Call_Id
“state”: “ringing” | “connected” | “disconnected”,
"channel_id": "xxxx"//channel id associated with the call leg
voice ID is a unique identifier created when a call is made. This identification shall be used for all subsequent requests to the server.
Call state events while connecting the call. ringing: Receiving ringing tone from called party connected: Call is accepted rejected: Call was not answered or declined by called party voicemail: Call was connected to voice mail
Originating number (typically configured number) used as the CLI
Destination number (aka Called party number)
Channel id associated with the call leg
Event’s timestamp created by server
This API is called to Hang up or disconnect the call.
Error Response: All error responses will follow the standard HTTP error format and error code. The JSON body of the response will highlight exact error that occurred and it’s description. Please see Erro codes here.
"channel_id": "xxxx", //channel id associated with the call leg
Events: If the event_url is provided, the system will let the application know regarding the status of disconnect
Voice server returns this error response when the text to speech conversion fails.
https: 503 Server not available
“msg”:”Error doing text to speech conversion”,
"timestamp": "2020-02-16T10:52:00Z "
Bridging -> if the other end is ringing Bridged -> If the call is accepted by the other party Bridge_disconnected -> if the call is disconnected by the bridged number, Disconnected: If the original participant disconnected the call.
The destination number where the call is bridged.
UTC timestamp at the time response was generated
These APIs are used for collecting live details about the call running in the system and state of the call.
API Route: https://voice.enablex.io/voice/v1/call/$voiceId/
Authorization: Basic XXXXXXXX
State of call after the current action: Connected : Call is running and is in progress In progress : Call is not yet connected … could be in ringing or attempting IVR : Call is connected and IVR is being played
Call originating number
UTC timestamp at the time response was generated
Error Response: All error responses will follow the standard HTTP error format and error code. The JSON body of the response will highlight the exact error that occurred and it’s description
HTTPS 400 . //Or other HTTP result on the REST
“from”: "CLI number",
“to”: "Called number",
This API is called to start or stop Recording on a live call.