Package com.vonage.client.voice
Class EventWebhook
java.lang.Object
com.vonage.client.JsonableBaseObject
com.vonage.client.voice.EventWebhook
- All Implemented Interfaces:
Jsonable
Represents all call events sent to the
event_url webhook configured in your Voice application settings.
See
the webhook reference for details. For the answer_url webhook, use AnswerWebhook.
The fields present depends on which event has occurred. This class maps all known fields for all events.- Since:
- 8.2.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic EventWebhookConstructs an instance, populating this class's fields from the JSON string.Unique identifier for the call event.Unique identifier for the conversation.Conversation ID that the leg was originally in.Conversation ID that the leg was transferred to.Provides a more specific status to accompany getStatus().Call direction, can be either inbound or outbound.getDtmf()DTMF capturing results.Call length, in seconds.End time in ISO 8601 format.getFrom()Number the call came from, in E.164 format.Advanced machine detection status, when call is answered by voicemail and the beep is detected.Type of network that was used in the call.getPrice()Total cost of the call in Euros.getRate()Cost per minute of the call, in Euros.Information about the nature of the error.Where to download the recording.Unique identifier for the recording.getSize()Size of the recording file, in bytes.Speech recognition results.Start time in ISO 8601 format.Event type.Event timestamp in ISO 8601 format.getTo()Number the call was made to, in E.164 format.Methods inherited from class com.vonage.client.JsonableBaseObject
createJsonObjectMapper, equals, hashCode, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.vonage.client.Jsonable
toJson, updateFromJson
-
Constructor Details
-
EventWebhook
protected EventWebhook()
-
-
Method Details
-
getStatus
Event type.- Returns:
- The call status as an enum.
-
getDirection
Call direction, can be either inbound or outbound.- Returns:
- The call direction as an enum, or
nullif not applicable.
-
getDetail
Provides a more specific status to accompany getStatus().- Returns:
- The event status detail as an enum, or
nullif not applicable.
-
getMachineDetectionSubstate
Advanced machine detection status, when call is answered by voicemail and the beep is detected. This is present if getStatus() is CallStatus.HUMAN or CallStatus.MACHINE.- Returns:
- The machine detection substate, or
nullif not applicable.
-
getDtmf
DTMF capturing results. This is only present if getStatus() is CallStatus.INPUT.- Returns:
- The DTMF input, or
nullif not applicable.
-
getSpeech
Speech recognition results. This is only present if getStatus() is CallStatus.INPUT.- Returns:
- The speech properties, or
nullif not applicable.
-
getTimestamp
Event timestamp in ISO 8601 format.- Returns:
- The timestamp as an Instant, or
nullif unknown.
-
getStartTime
Start time in ISO 8601 format. This is applicable to recording events.- Returns:
- The start time as an Instant, or
nullif unknown / not applicable.
-
getEndTime
End time in ISO 8601 format. This is applicable to recording events.- Returns:
- The end time as an Instant, or
nullif unknown / not applicable.
-
getDuration
Call length, in seconds. This is present if getStatus() is CallStatus.COMPLETED.- Returns:
- The length of the call, or
nullif not applicable.
-
getSize
Size of the recording file, in bytes. This is present for recording events only.- Returns:
- The file size in bytes, or
nullif not applicable.
-
getRate
Cost per minute of the call, in Euros. This will be present if getStatus() is CallStatus.COMPLETED.- Returns:
- The call rate as a double, or
nullif not applicable.
-
getPrice
Total cost of the call in Euros. This will be present if getStatus() is CallStatus.COMPLETED.- Returns:
- The call cost as a double, or
nullif not applicable.
-
getRecordingUrl
Where to download the recording. This is present for recording and transcription events only.- Returns:
- The URL of the recording, or
nullif not applicable.
-
getCallUuid
Unique identifier for the call event.- Returns:
- The call ID as a string, or
nullnot applicable.
-
getRecordingUuid
Unique identifier for the recording. This is only present for recording events.- Returns:
- The recording ID as a string, or
nullif not applicable.
-
getTo
Number the call was made to, in E.164 format.- Returns:
- The call destination, or
nullif not applicable.
-
getFrom
Number the call came from, in E.164 format.- Returns:
- The call source number, or
nullif not applicable.
-
getConversationUuid
Unique identifier for the conversation. Starts withCON-followed by a UUID.- Returns:
- The conversation ID as a string, or
nullif not applicable.
-
getConversationUuidFrom
Conversation ID that the leg was originally in. This is only present if getStatus() is CallStatus.TRANSFER.- Returns:
- The originating conversation ID leg, or
nullif not applicable.
-
getConversationUuidTo
Conversation ID that the leg was transferred to. This is only present if getStatus() is CallStatus.TRANSFER.- Returns:
- The destination conversation ID leg, or
nullif not applicable.
-
getNetwork
Type of network that was used in the call.- Returns:
- The network, or
nullif unknown / not applicable.
-
getReason
Information about the nature of the error. This is only present for error webhooks.- Returns:
- The error description, or
nullif not applicable.
-
fromJson
Constructs an instance, populating this class's fields from the JSON string.- Parameters:
json- The JSON payload as a string.- Returns:
- A new instance of this class.
-