Package com.vonage.client.voice
Class Call.Builder
java.lang.Object
com.vonage.client.voice.Call.Builder
- Enclosing class:
Call
Builder for constructing a Call object.
- Since:
- 7.3.0
-
Method Summary
Modifier and TypeMethodDescriptionadvancedMachineDetection(AdvancedMachineDetection advancedMachineDetection) Configure the behavior of Vonage's advanced machine detection.answerMethod(HttpMethod answerMethod) The HTTP method used to send event information toanswer_url.The webhook endpoint where you provide the Nexmo Call Control Object that governs this call.build()Builds the Call object with this builder's properties.eventMethod(HttpMethod eventMethod) The HTTP method used to send event information toevent_url.The webhook endpoint where call progress events are sent to.Connect to a Phone (PSTN) number.fromRandomNumber(boolean fromRandomNumber) Set to @{code true} to use random phone number as the caller.lengthTimer(int lengthTimer) Sets the number of seconds that elapse before Vonage hangs up after the call is answered.machineDetection(MachineDetection machineDetection) Configure the behavior when Vonage detects that the call is answered by voicemail.Sets the actions to take on the call.ncco(Collection<? extends Action> nccos) Sets the actions to take on the call.ringingTimer(int ringingTimer) Sets the number of seconds that elapse before Vonage hangs up after the call state changes to ‘ringing’.Sets the endpoints (recipients) of the call.
-
Method Details
-
to
Sets the endpoints (recipients) of the call.- Parameters:
endpoints- The recipients of the call in order.- Returns:
- This builder.
-
from
Connect to a Phone (PSTN) number.- Parameters:
number- The number to place the call from in E.164 format.- Returns:
- This builder.
-
eventMethod
The HTTP method used to send event information toevent_url.- Parameters:
eventMethod- The method type (must beGETorPOST).- Returns:
- This builder.
-
answerMethod
The HTTP method used to send event information toanswer_url.- Parameters:
answerMethod- The method type (must beGETorPOST).- Returns:
- This builder.
-
eventUrl
The webhook endpoint where call progress events are sent to. For more information about the values sent, see the Event webhook documentation.- Parameters:
eventUrl- The event updates URL.- Returns:
- This builder.
-
answerUrl
The webhook endpoint where you provide the Nexmo Call Control Object that governs this call.- Parameters:
answerUrl- The NCCO answer URL.- Returns:
- This builder.
-
machineDetection
Configure the behavior when Vonage detects that the call is answered by voicemail. If MachineDetection.CONTINUE, Vonage sends an HTTP request toevent_urlwith the Call event machine. If MachineDetection.HANGUP, Vonage ends the call.- Parameters:
machineDetection- The machine detection mode.- Returns:
- This builder.
-
advancedMachineDetection
Configure the behavior of Vonage's advanced machine detection. This overrides themachineDetection(MachineDetection), so you cannot set both.- Parameters:
advancedMachineDetection- The advanced machine detection settings.- Returns:
- This builder.
- Since:
- 7.4.0
-
lengthTimer
Sets the number of seconds that elapse before Vonage hangs up after the call is answered.- Parameters:
lengthTimer- The call length in seconds. The default and maximum is 7200.- Returns:
- This builder.
-
ringingTimer
Sets the number of seconds that elapse before Vonage hangs up after the call state changes to ‘ringing’.- Parameters:
ringingTimer- The time to wait whilst ringing in seconds. Maximum is 120, default is 60.- Returns:
- This builder.
-
fromRandomNumber
Set to @{code true} to use random phone number as the caller. The number will be selected from the list of the numbers assigned to the current application. Cannot be used iffrom(String)is set.- Parameters:
fromRandomNumber- Whether to use a random number instead offrom.- Returns:
- This builder.
-
ncco
Sets the actions to take on the call.- Parameters:
actions- The actions in order.- Returns:
- This builder.
-
ncco
Sets the actions to take on the call.- Parameters:
nccos- The NCCOs to use for this call.- Returns:
- This builder.
-
build
Builds the Call object with this builder's properties.- Returns:
- The constructed Call instance.
-