Table of Contents

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

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 the 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.

If the developer intend to make programatic decision if the call to be accepted or not, the “/accept” API should be used.

Example: Incoming Event JSON

{
	“voice_id”: “f1aa71c0-8f2a-4fe8-b5ef-9a330454ef58”,
	“state”: “incomingcall”,
	“from”: “CLI number”,
	“to”: “Destination number”,
	“channel_id”:
	“timestamp: “2020-02-16T10:52:00Z”
}
KeyDescription
voice_idvoice_id of the incoming call. This identification
shall be used for all further requests to
the server.
stateIncoming 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
fromOriginating phone number – also known as Caller Id
toThe number to which the call is dialed in. Phone number assigned to voice service for the project.
timestampTimestamp at which the call is received

In case if the developer needs to take control of the call before it is auto-answered, developer should remove the default greetings and implement the webhook for notification of the incoming call. Once the application receives the webhook event, the following “/accept” API can be used to accept a call. If this API is not called, the incoming call will not be answered and the call shall be dropped.

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

Request Example:

POST https://voice.enablex.io/voice/v1/call/f1aa71c0-8f2a-4fe8-b5ef-9a330454ef58/accept
Authorization: Basic xxxxx

Responses:

HTTPS 200 Success. //Or other standard HTTP result
{
"voice_id": "3d561239-a1e8-43dd-bd6d-73f60b027a81"
"status": "success"
}

Key Description:

voice_idVoice instance of the voice service call.
statusstatus of the accept call

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.

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

Request Example:

POST https://api.enablex.io/voice/v1/call 
Authorization: Basic XXXXXX
Content-Type: application/json

{
	"name": "service name",
	"owner_ref": "xzy",
	"auto_record": false,
	"from":"CLI number",
	"to": "Destination number",
         
	"action_on_connect": {
		"play": {   
			"prompt_name":"prompt_name",
                        "asr":true
		}, // Or  
		"play":{ 
			"text": "your prompt here",
			"language": "en-US",
			"voice": "female",
                        "asr":true   
		}, 
                "start_timeout": 10, 
                "recognizer_timeout": 1               
	}
        "event_url": "https://yourserver.com/webhook"
}
Object/KeyDescriptionConstraints
nameOptional parameter to name this service Optional
owner_refFree 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.Optional
auto_recordRecording by default or on commandOptional
fromThe CLI assigned on the outbound number. This number is matched with the configured number. Mandatory
toDestination numberMandatory
action_on_connect If set, prompt will be played automatically when destination number is connectedOptional
actionSpecifies the action to perform when an outbound call is
connected. Action, could either be:
To connect the call
To bridge the call with one more participant
or Play voice prompt or voice menu
Optional
prompt_namePlays the prompt that has been uploaded with Prompt Id
through portal provisioning
Optional
textTTS to play the prompt according to the parameter defined as following parameters belowOptional
languageThe preferred spoken language for TTS Conditional, if text
is supported
voiceVoice genderConditional. Need to
be there if “text” is present.
asrEnable Automatic Speech Recognition, to detect words/sentences and return in the textOptional
start_timeout Initial silence timeout before user start speaking.  
Range : 1 – 10 seconds. 
Default : 10 seconds. 
Optional
recognizer_timeout Wait before the voice server returns the result after silence. 
Range : 1 – 10 seconds. 
Default : 2 seconds. 
Optional
event_urlWebhook URL to be called for the application to take controlOptional

Try Open API Tool…

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.

Response Example

{     
	"voice_id:  
	“state: “initiated”,	// If failed  state will be "failed"                            
	“msg”: string,     
	“owner_ref”:		// User defined Id                              
	“time_stamp": "2020-02-16T10:52:00Z"              
}
KeyDescription
voice_idVoice Call Identifier
statestate could be initiated | failed
msgTextual description of the reason code
owner_refFree data passed during the request
timestampUTC 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:

{   
	"result": 1234, // 4 digit error code
	"msg": "description of the error",
	"state": "failed",
	"timestamp": “2020-02-16T10:52:00Z”
}

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” | "voicemail",
        "from": "CLI number",
        "to": "Destination number",
        "channel_id": "xxxx"//channel id associated with the call leg
        "timestamp": "2020-02-16T10:52:00Z",
}
KeyDescription
voice_idvoice ID is a unique identifier created when a call is made.
This identification shall be used for all subsequent requests to the server.
stateCall state events while connecting the call.
ringing: Receiving ringing tone from called party
connected: Call is accepted
disconnected: Call was not answered or declined by called party
voicemail: Call was connected to voice mail, only if voice mail detection is enabled.
from Originating number (typically configured number) used as the CLI
toDestination number (aka Called party number)
channel_idChannel id associated with the call leg
timestampEvent’s timestamp created by server

Receive DTMF

EnableX receives DTMF on the voice call and can dispatch it to the application for further processing.


DTMFs are asynchronous events, and EnableX expect API developers to provide a Webhook. The Webhook will be invoked by the EnableX platform on Application server in the DTMF event.


The DTMF are conveyed in plain text, but are encrypted by the Webhook security provided by the platform.


Note: This Event is different from digitcollected event which comes for voice menu, and this event will come only after call is bridged.

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
	“channel_id”:” fdgdfg451c0-8f2a-4fe8-b5ef-9addawrttfh”,
	“state”: “dtmfcollected”,
	“digit”: 12345,
	“timestamp": "2017-02-16T10:52:00Z"
}
KeyDescription
voice_idvoice ID is a unique identifier
channel_idUnique channel ID of the channel which received DTMF
stateState of Event: dtmfcollected
digitDTMF value pressed by user
timestampUTC timestamp at which the response was generated

Receive Speech recognition results

EnableX passes the recognized sppech text as event to the application. The text could be a word or sentence.

Application should accept the text and may need to add algorithm to detect the word correctly, as speech recognition depends on various factors and accuracy is always subjective.

The recognized text will be available in the event under attribute: recognized_phrase

Events: Events will be triggered by the system will be called using the webHooks provided by the API

{ 
   "voice_id": "6b211e69-c2cc-4a65-99e9-f7a3c6922796", 
   "result": { 
   "reason": " RecognizedSpeech” 
   }, 
   "state": "recognized |  timeout | unrecognized", 
   "from": "CLI number", 
   "to": "Destination number", 
   "asr_id": "50f4dcd7-5f9b-4b62-a86f-5e2ab65ab84c", 
   "recognised_phrase": "No, I'm not available.", 
   "prompt_ref": "welcome-prompt" 
} 

Transfer Call

EnableX provides a way to perform a attended or consulted transfer by using this call. It is assumed that you have a bridged (i.e. 2 participants) call exist and want to transfer one call leg to external or terminating number.

API Route: https://api.enablex.io/voice/v1/call/$voiceId/transfer

PUT https://api.enablex.io/voice/v1/call/f1aa71c0-8f2a-4fe8-b5ef-9a330454ef58/transfer
Authorization: Basic xxxxxx
Content-Type: application/json 

{ 
	"from": "CLI number",		// Valid CLI
        "transfer_to": "Terminating number”
}
KeyDescriptionConstraints
fromOriginating phone number – also known as Caller IdMandatory
transfer_toThe Destination NumberMandator

Try Open API Tool…

Response: Response to REST will be the standard response. Immediate response if the server has accepted the request from client

Response Example: HTTPS 200 Success

{
	"voice_id": "3d561239-a1e8-43dd-bd6d-73f60b027a81",
	"from": "CLI number",
	"to": "Destination number" ,
	"status": "initiated",
	"channel_id": "fdgdfg451c0-8f2a-4fe8-b5ef-9addawrttfh",
	"timestamp": "2020-08-20T09:03:09.893Z"
}
KeyDescription
voice_idVoice instance of the voice service call
fromOriginating phone number – also known as Caller Id
toThe destination number where the call is bridged
statusState of the transfer request Possible states are: initiated or failed (All call related events shall be posted on webhook)
channel_idUnique identifier for the channel
timestamp UTC timestamp at which the response was generated

Error Response Example: HTTPS 409 Call State Mismatch

{
	"voice_id": "3d561239-a1e8-43dd-bd6d-73f60b027a81",
        "from": "CLI number",
        "to": "Destination number",
	"status": "failed",
	"msg": "Call is not bridged yet",
	"timestamp": "2020-08-20T09:03:09.893Z"
}
KeyDescription
voice_idUnique call identifier
msgTextual description on failure
timestampUTC timestamp at which the response was generated

Error Response Example: HTTPS 500 Internal Server Error

{
	"voice_id": "3d561239-a1e8-43dd-bd6d-73f60b027a81",
	"from": "CLI number",
	"to": "Destination number",
	"status": "failed",
	"result": 500,
	"msg": "Internal Server Error",
	"timestamp": "2020-08-20T09:03:09.893Z"
}
KeyDescription
voice_idVoice instance of the voice service call
fromOriginating phone number – also known as Caller Id
toThe destination number where the call is bridged
resultResult Code
msgTextual description of Result Code
timestamp UTC timestamp at which the response was generated

Forward Call

This API is called to forward bridged call leg.

API Route: https://api.enablex.io/voice/v1/call/$voiceId/forward

PUT https://api.enablex.io/voice/v1/call/f1aa71c0-8f2a-4fe8-b5ef-9a330454ef58/forward
Authorization: Basic xxxxxx
Content-Type: application/json 

{ 
	"from": "CLI number",		// Valid CLI
        "to": "Destination number”
}
KeyDescriptionConstraints
fromOriginating phone number – also known as Caller IdMandatory
toThe Destination NumberMandator

Response: Response to REST will be the standard response. Immediate response if the server has accepted the request from client

Response Example: HTTPS 200 Success

{
	"voice_id": "3d561239-a1e8-43dd-bd6d-73f60b027a81",
	"from": "CLI number",
	"to": "Destination number",
	"status": "success",
	"timestamp": "2020-08-20T09:03:09.893Z"
}
KeyDescription
voice_idVoice instance of the voice service call
fromOriginating phone number – also known as Caller Id
toThe destination number where the call is bridged
statusState of the forward request. Possible states are: failed, success
timestamp UTC timestamp at which the response was generated

Try Open API Tool…

Error Response Example: HTTPS 409 Call State Mismatch

{
	"voice_id": "3d561239-a1e8-43dd-bd6d-73f60b027a81",
        "from": "CLI number",
        "to": "Destination number",
	"status": "failed",
	"msg": "Call is not bridged yet",
	"timestamp": "2020-08-20T09:03:09.893Z"
}
KeyDescription
voice_idUnique call identifier
msgTextual description on failure
timestampUTC timestamp at which the response was generated

Error Response Example: HTTPS 500 Internal Server Error

{
	"voice_id": "3d561239-a1e8-43dd-bd6d-73f60b027a81",
	"from": "CLI number",
	"to": "Destination number",
	"status": "failed",
	"result": 500,
	"msg": "Internal Server Error",
	"timestamp": "2020-08-20T09:03:09.893Z"
}
KeyDescription
voice_idVoice instance of the voice service call
fromOriginating phone number – also known as Caller Id
toThe destination number where the call is bridged
resultResult Code
msgTextual description of Result Code
timestamp UTC timestamp at which the response was generated

Play Voice Prompt

This API is called to Play prompts in the call. This command can be used to play prompts from TTS engine or stored pre-recorded prompt or from the remote URL. Action describes the start and stop play.

API Route: https://api.enablex.io/voice/v1/call/$voiceId/play

PUT https://api.enablex.io/voice/v1/call/f1aa71c0-8f2a-4fe8-b5ef-9a330454ef58/play
Authorization: Basic xxxxxx
Content-Type: application/json 
{
  //Play parameters
  "prompt_name":"prompt file name to be played",
  // or
  "text": "text to be played"
  “language”: “es-US",
  “voice”: "female",
  “dtmf”: true  
  "prompt_ref":"welcom_ref" // optional parameter for user reference.
  //asr parameter
  "asr": true  // user input via speech
  start_timeout :10 // initial silence timeout before user start speaking
  recognizer_timeout: 1 // wait timer before recognizer returns the result.
}
KeyDescriptionConstraints
prompt_nameIdentifier of the prompt as configured on the portal. Required if text is not used
textText to be played by the TTS. Either text or prompt will be be playedRequired if prompt_name is not used
voiceFor TTS only. Possible value is male or femaleMandatory if text is used.
languageLanguage to be spokenMandatory if the text is used.
dtmfIf dtmf is true, it will wait for
digits
Optional
prompt_refUser specified prompt_refOptional
asrIVR via speech recognition enabled. Optional
start_timeoutInitial Silence Timeout before user start speaking.  
Range : 1 – 10 seconds. 
Default : 10 seconds. 
Optional
recognizer_timeoutWait before the voice server returns the result after silence. 
Range : 1 – 10 seconds. 
Default : 2 seconds. 
Optional

Try Open API Tools…

Response: Response to REST will be the standard response.

Success Response Example: HTTPS  200  Accepted

 {
	"voice_id": "f1aa71c0-8f2a-4fe8-b5ef-9a330454ef58",
	"play_id: “fdgdfg451c0-8f2a-4fe8-b5ef-9addgdg58”, 
	“playstate”:”initiated”, // Other playstates will be delivered on webhook
	"from": "CLI number",
	"to" : "Destination number"
	"timestamp": "2020-02-16T10:52:00Z"
}
KeyDescription
playstateinitiated
play_idPlayer identifier
voice_idUnique call identifier
timestamp UTC timestamp at the time response was generated

Events: The event will be called upon a Webhook

{ 
	“voice_id”: a8e3607c-46a1-43f6-b0be-f3ead722a6b1,
	"from": "CLI number", 
	"to" : "Destination number", 
	“play_id” “fdgdfg451c0-8f2a-4fe8-b5ef-9addgdg58”,
	“playstate”:  ”playfinished| “failed”|”digitcollected”|”menutimeout”,
	”prompt_ref”:”optional prompt_ref”,
	“digit”: 12345, 
	"timestamp": "2020-02-16T10:52:00Z" 
}
KeyDescription
voice_idUnique call identifier
play_idUnique PlayId returned to indicate action
playstateState of the current action:
playfnished: Completed the play prompt
digitcollected: user have provided DTMF for voice menu prompt
menutimeout: user haven’t provided any DTMF for voice menu prompt
failed: Could not play the prompt
prompt_refUser specified prompt_ref
digitDTMF digits collected, in case playstate in digitcollected
timestampUTC timestamp at the time response was generated

Error Response: API returns below error response in case of failure. All error responses will follow the standard HTTP error format and error code i.e. HTTPS 4**, 5**.

{
	"voice_id": "f1aa71c0-8f2a-4fe8-b5ef-9a330454ef58",
	"play_id": "f1aa71c0-8f2a-4fe8-b5ef-9a330454ef58",
	"timeStamp": "2017-02-16T10:52:00Z",
	“result” : “code”,
	"msg": "Description" 
}
KeyDescription
voice_idVoice Call Identifier
play_idPlayer identifier
resultResult Code
msgText Description of Result Code
timestamp UTC timestamp at the time response was generated

Error Response: HTTPS 405 Method Not allowed. Voice Server returns this error when the call is in bridged mode and cannot play the prompt

{
	“voice_id”: a8e3607c-46a1-43f6-b0be-f3ead722a6b1
	"from": "CLI number",
	"to" : "Destination number",
	“state”:”failed”,
	“result" :6112,
	“msg”:”Call is in bridged mode, can't play media”,
	"timestamp": "2020-02-16T10:52:00Z "
 }

Error Response: HTTPS 406 Not acceptable. Voice Server returns this error when the voice/language is not supported for the text-to-speech conversion

{
	"voice_id": a8e3607c-46a1-43f6-b0be-f3ead722a6b1
	"from": "CLI number",
	"to" : "Destination number",
	"result" :6117,
	"msg":"Voice not supported for text-to-speech  conversion",
	"state": "failed",
	"timestamp": "2020-02-16T10:52:00Z "
 }

Error Response: HTTPS 408 request pending. Voice server returns this error response when the text to speech conversion fails.

{
	“voice_id”: a8e3607c-46a1-43f6-b0be-f3ead722a6b1
	“from”:"CLI number",
	“to”:"Destination Number",
	“status”:”failed”,
	“result" : 6114,
	“msg”:”Play request pending”,
	"timestamp": "2020-02-16T10:52:00Z "
 }

Error Response: HTTPS 400 bad request. Voice server returns this error when the media request failed

{
	“voice_id”: a8e3607c-46a1-43f6-b0be-f3ead722a6b1
	"from": "CLI number",
	"to" : "Destintion number",
	“status”:”failed”,
	“result" :400,
	“msg”: ”Media Request Failed”,
	"timestamp": "2020-02-16T10:52:00Z "
 }

Error Response: HTTPS 503 Server not available. Voice server returns this error response when the text to speech conversion fails.

{
	“voice_id”: a8e3607c-46a1-43f6-b0be-f3ead722a6b1
	“from”:"CLI number",
	“to”:"Destination number",
	“state”:”failed”,
	“result" : 6107,
	“msg”: ”Error doing text to speech conversion”,
	"timestamp": "2020-02-16T10:52:00Z "
 }

Bridge Call

This API is called to bridge the call between two participants.

API Route: https://api.enablex.io/voice/v1/call/$voiceId/connect

Request Example

PUT  https://voice.enablex.io/voice/v1/call/f1aa71c0-8f2a-4fe8-b5ef-9a330454ef58/connect
Authorization: Basic xxxxxx
Content-Type: application/json 

{
	"from": "CLI number",
	"to" : "Destination number"
}
KeyDescriptionConstraints
fromOriginating phone number – also known as Caller IdMandatory
toThe destination number or SIP URIMandatory

Try Open API Tool…

Response: HTTPS 200 Accepted. Response to REST will be the standard response

{
	"voice_id": "f1aa71c0-8f2a-4fe8-b5ef-9a330454ef58",
	"bridge_id":  "xxxxx",  
	"state": “Initiated”  |  “failed”,  
	"from": "CLI number",
	"to" : "Destination number"
	"timeStamp": "2017-02-16T10:52:00Z"
 }
KeyDescription
voice_idVoice instance of the voice service call.
bridge_id Unique identifier for the Bridge
stateState of the bridge request. Possible values initiated or failed.
fromValid CLI which is used as Caller Id for this call.
toThe destination number where the call is bridged.
timestampUTC timestamp at the time response was generated

Events: Event will be called upon a Webhook provided by application server using API

{
	"voice_Id": "f1aa71c0-8f2a-4fe8-b5ef-9a330454ef58",  
	“state": “briding" | "bridging_failed"| "bridge_disconnected" | ”bridged”,
	“from”:  "CLI number",
	"to": "Destination number",
	"timestamp": "2017-02-16T10:52:00Z"
}
KeyDescription
voice_idUnique call identifier
statebridging : if the other end is ringing
bridged : If the call is accepted by the other party
bridge_failed : Failed to bridge the call.
bridge_disconnected : if the call is disconnected by the bridged number,
disconnected : If the original participant disconnected the call.
fromOriginating phone number – also known as Caller Id
toThe destination number where the call is bridged.
timestampUTC timestamp at the time response was generated

Error: Bridge API returns below error in case of failure. 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.

Error Response: HTTPS 404 Not Found. Voice Server returns this error response when Outbound/Inbound Service is not configured for the Number

{
	“result": "6110",
	“msg”: "Application Not Found”,
	“state”: "failed",
	"timestamp": "2020-02-16T10:52:00Z"
}

Error Response: HTTPS 404 Phone Number Not Found. Voice Service returns this error when the CLI number does not have any service configured

{
	“result": "6118",
	“msg”: "Phone number not found for the service”,
	“state”: "failed",
	"timestamp": "2020-02-16T10:52:00Z"
}

Analyze Call

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/

Request Example:

GET  https://api.enablex.io/voice/v1/call/f1aa71c0-8f2a-4fe8-b5ef-9a330454ef58
Authorization: Basic XXXXXXXX 

Response:

{
	"voice_id": "f1aa71c0-8f2a-4fe8-b5ef-9a330454ef58", // Call_Id
	"state”: “connected”, /* connected,  In progress, IVR” */
	“direction”: “Inbound”, /* Inbound, Outbound */ 
	"from": "CLI number",
	"to" : "Destination number",
	"timestamp": "2017-02-16T10:52:00Z"
}  
KeyDescription
voice_idUnique call identifier
stateState 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
fromOriginating phone number – also known as Caller Id
toDestination Number
timestampUTC timestamp at the time response was generated

Try Open API Tool...

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 
{
	"voice_id": "f1aa71c0-8f2a-4fe8-b5ef-9a330454ef58",  
	“from”: "CLI number",
	“to”: "Destination number",
	"result": "Number",
	"msg": "",
	"timestamp": "2017-02-16T10:52:00Z"
}

Call Hold-Unhold API

This API is called to Hold/Resume a bridged channel and to play music on hold.  

API Route: https://api.enablex.io/voice/v1/call/$voiceId/hold

Request Example: To hold bridged call leg

POST https://voice.enablex.io/voice/v1/call/f1aa71c0-8f2a-4fe8-b5ef-9a330454ef58/hold
Authorization: Basic xxxxxx
Content-Type: application/json
{
"hold": true,
OR
“hold”: false
}
holdtrue: to hold the bridged call leg.
false: to resume the bridged call leg.
Mandatory

Try Open API Tool…

Start / Stop Call Recording

This API is called to start or stop Recording on a live call.

API Route: https://api.enablex.io/voice/v1/call/$voiceId/recording

Request Example: To start call recording

PUT https://voice.enablex.io/voice/v1 /call/f1aa71c0-8f2a-4fe8-b5ef-9a330454ef58/recording
Authorization: Basic xxxxxx
Content-Type: application/json 
 
{
	"start": true,
	"recording_name": "my_voice_recording" 
}

Try Open API Tool…

Request Example: To stop call recording

PUT https://voice.enablex.io/voice/v1 /call/f1aa71c0-8f2a-4fe8-b5ef-9a330454ef58/recording
Authorization: Basic xxxxxx
Content-Type: application/json 
 
{
	"stop": true 
}
KeyDescriptionConstraint
startBoolean. Required to start recording; set to true.Required
recording_name If User specifies recording_name and any recording file with same name already exist, the request will fail Optional
stopBoolean. Required to stop recording; set to true.Required

Response: Immediate response if the server has accepted the request from the client

Success Response: HTTPS 200 Success

{
         “status”: "success",
         “from”: "CLI number",
         "to": "Destination number",
         "voice_id": "f1aa71c0-8f2a-4fe8-b5ef-9a330454ef58",  
         “recording_id”: “uniquerecording identifier”,
         "timeStamp": "2017-02-16T10:52:00Z" 
}
KeyDescription
voice_idUnique call identifier
recording_idUnique recording identifier
statesuccess – to know recording started successfully
msgFailure description (blank in case of success)
timestampUTC timestamp at the time response was generated

Error Response: HTTPS 500. Voice Service returns this error when it fails to start call recording

{
         “status”: "failed",
         “from”: "CLI number",
         "to": "Destination number",
         "voice_id": "f1aa71c0-8f2a-4fe8-b5ef-9a330454ef58",  
         “result”: “6119”,
         “msg”: “Failed to start recording on bridge”
         "timeStamp": "2017-02-16T10:52:00Z"
}

Error Response: HTTPS 409 Call State Mismatched

{
         “status”: "failed",
         “from”: "CLI number ",
         "to": "Destination number",
         "voice_id": "f1aa71c0-8f2a-4fe8-b5ef-9a330454ef58",  
         “result”: “409”,
         “msg”: “Call is not bridged yet”
         "timeStamp": "2017-02-16T10:52:00Z"}

Error Response: HTTPS 408 Request Pending

{
         “status”: "failed",
         “from”: "CLI number",
         "to": "Destination number",
         "voice_id": "f1aa71c0-8f2a-4fe8-b5ef-9a330454ef58",  
         “result”: “408”,
         “msg”: “Call is already recording”
         "timeStamp": "2017-02-16T10:52:00Z"
}

Events: Events of various progression of the recording will be sent back to application via Event URLs.

{
         "voice_id": "f1aa71c0-8f2a-4fe8-b5ef-9a330454ef58",  
         "recording_id": "8f2a-4fe8-b5ef-9a330",
         “state”: “started”, /* started,  completed, failed */
         “msg”: "text",
         "timestamp": "2017-02-16T10:52:00Z"
}
KeyDescription
voice_idUnique call identifier
recording_idUnique recording identifier
stateState of call after the current action:
started—Recording started
completed—Recording completed
failed—recording failed for reason code
msgFailure description (blank in case of success)
timestampUTC timestamp at the time response was generated

Retrieve Call Recording

This API is used to pull Recorded File(s) by the client app.

API Route: https://api.enablex.io/voice/v1/recordubg/$recordingId

GET https://voice.enablex.io/v1/recording/1aa71c0-8f2a-4fe8-b5ef-9a330454ef58
Authorization: Basic XXXXXXXX

Success Response: HTTPS 200. File download starts from server.

Error Response: HTTPS  404 Not Found

{
	"result":404,
	"msg":"Recording File Not Found"
}
KeyDescription
resultResult Code
msgTextual description of Result code

Hang-Up Call

This API is called to Hang up or disconnect the call.

API Route: https://api.enablex.io/voice/v1/call/$voiceId/

Request Example: To hangup call

DELETE https://voice.enablex.io/v1/call/1aa71c0-8f2a-4fe8-b5ef-9a330454ef58
Authorization: Basic XXXXXXXX

Try Ope API Tool…

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.

Response Example:

{
	“voice_id": "f1aa71c0-8f2a-4fe8-b5ef-9a330454ef58",
	“state”:success,
	"from": "CLI number",
	"to": "Destination number",
	"channel_id": "xxxx", //channel id associated with the call leg
	"timeStamp": "2020-02-16T10:52:00Z"
 }

Events: If the event_url is provided, the system will let the application know regarding the status of disconnect

{
	 "voice_id": "f1aa71c0-8f2a-4fe8-b5ef-9a330454ef58",  
	 “state”: “Disconnected”,
	 "timeStamp": "2020-02-16T10:52:00Z"
}
KeyDescription
voice_idA unique identifier on which the disconnect call is invoked.
stateDisconnected or error
(Call could fail for invalid parameters or if call does not exist)