Voice Notifications

A notification is a HTTP POST request that is sent to your callback url when a specific event happens.
To set your callback url, on the dashboard sidebar click Voice -> Phone Numbers -> Actions -> Callback.

Types of Voice notifications

The point at which notifications are sent for various Voice categories is shown below:

Category Notification Point
Outbound calls We send a notification whenever you make a call from a registered sip number.
Inbound calls We send a notification when a call comes to your virtual or sip number.
After input Whenever an action in your response requires user input (such as GetDigits and Record), we will send a notification with the input.
After call We send a notification after a call ends. This is the final notification and contains some extra information about the call like the cost and duration.

These are the parameters that will be sent to your callback URL.

Variable Name Description
isActive
String
This variable lets your application know whether the call is in session state. The API will set a value of 0 in the final request to your application.
sessionId
String
This is a unique identifier that we will generate during each call session. This variable will stay the same throughout the call.
direction
String
Whether this is an inbound or outbound call. Inbound calls are initiated by a phone user while outbound calls are initiated by your application.
destinationNumber
String
destinationNumber is Your Africa's Talking phone number. This will also be presented in international format, starting with a +.
callerNumber
String
The phone number of the phone user in the call. The phone numbers are all in international format, starting with a + (such as +254711XXXYYY).
callerCountryCode
String
The code of the country the callerNumber is calling from.
callStartTime
String
The time the call began.
dtmfDigits
String
This variable contains the digits that a user enters in response to a getDigits request. Only present in a notification following a GetDigits response.
recordingUrl
String
The URL of the recording made for this call (using either the Record element, or the record attribute of the Dial element). Only present in the notification following a partial recording, or in the final notification if it is a terminal recording.
durationInSeconds
String
The duration of the call in seconds. Only present in the final notification.
currencyCode
String
The currency used to bill this call (e.g KES, USD, GBP). Only present in the final notification.
amount
String
The total cost of the call. Only present in the final notification.
callSessionState
String
The final status of the call. Only present in the final notification.
dialDestinationNumber
String
The number which a call was forwarded to if the Dial action was used. Only present in the final notification.
dialDurationInSeconds
String
The duration of the dialed call if the Dial action was used. Only present in the final notification.
dialStartTime
String
The time the dial action began if the Dial action was used. Only present in the final notification.