Package com.vonage.client.voice.ncco
Class ConnectAction.Builder
java.lang.Object
com.vonage.client.voice.ncco.ConnectAction.Builder
- Enclosing class:
ConnectAction
-
Method Summary
Modifier and TypeMethodDescriptionadvancedMachineDetection(AdvancedMachineDetection advancedMachineDetection) Configure the behavior of Vonage's advanced machine detection.build()Builds the ConnectAction.Connect the call to a specific Endpoint.endpoint(Collection<Endpoint> endpoint) Deprecated.This will be removed in the next major release.eventMethod(EventMethod eventMethod) The HTTP method Vonage uses to make the request to eventUrl.Set toEventType.SYNCHRONOUSto: Make the connect action synchronous.Set the webhook endpoint that Vonage calls asynchronously on each of the possible Call States.eventUrl(Collection<String> eventUrl) Set the webhook endpoint that Vonage calls asynchronously on each of the possible Call States.Sets the caller ID number.Maximum length of the call in seconds.machineDetection(MachineDetection machineDetection) Configure the behavior when Vonage detects that a destination is an answerphone.randomFromNumber(boolean randomFromNumber) Use a random phone number asfrom.ringbackTone(String ringbackTone) A URL value that points to a ringback tone to be played back on repeat to the caller, so they don't hear silence.If the call is unanswered, set the number in seconds before Vonage stops ringing endpoint.
-
Method Details
-
endpoint
Deprecated.This will be removed in the next major release.Connect the call to a specific Endpoint.- Parameters:
endpoint- The endpoints to connect to.- Returns:
- This builder.
-
endpoint
Connect the call to a specific Endpoint.- Parameters:
endpoint- The endpoint(s) to connect to.- Returns:
- This builder.
-
from
Sets the caller ID number. This must be one of your Vonage virtual numbers. Any other value will result in the caller ID being unknown.- Parameters:
from- The caller number in E.164 format.- Returns:
- This builder.
-
eventType
Set toEventType.SYNCHRONOUSto:- Make the connect action synchronous.
- Enable eventUrl to return an NCCO that overrides the current NCCO when a call moves to specific states.
- Parameters:
eventType- The event type as an enum.- Returns:
- This builder.
-
timeOut
If the call is unanswered, set the number in seconds before Vonage stops ringing endpoint. The default value is 60, minimum is 3 and maximum is 7200 (2 hours).- Parameters:
timeOut- The call timeout in seconds.- Returns:
- This builder.
-
limit
Maximum length of the call in seconds. The default and maximum value is 7200 seconds (2 hours).- Parameters:
limit- The maximum call length as an int.- Returns:
- This builder.
-
machineDetection
Configure the behavior when Vonage detects that a destination is an answerphone.- Parameters:
machineDetection- Set to either:-
MachineDetection.CONTINUEVonage sends an HTTP request to event_url with the Call event machine -
MachineDetection.HANGUPto end the Call
-
- Returns:
- This builder.
-
advancedMachineDetection
public ConnectAction.Builder advancedMachineDetection(AdvancedMachineDetection 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
-
eventUrl
Set the webhook endpoint that Vonage calls asynchronously on each of the possible Call States. If eventType is set to synchronous the eventUrl can return an NCCO that overrides the current NCCO when a timeout occurs.- Parameters:
eventUrl- The event URLs.- Returns:
- This builder.
-
eventUrl
Set the webhook endpoint that Vonage calls asynchronously on each of the possible Call States. If eventType is set to synchronous the eventUrl can return an NCCO that overrides the current NCCO when a timeout occurs.- Parameters:
eventUrl- The event URL(s).- Returns:
- This builder.
-
eventMethod
The HTTP method Vonage uses to make the request to eventUrl. The default value is EventMethod.POST.- Parameters:
eventMethod- The HTTP method as an enum.- Returns:
- This builder.
-
randomFromNumber
Use a random phone number asfrom. The number will be selected from the list of the numbers assigned to the current application. The application will try to use number(s) from the same country as the destination (if available). If set totrue, cannot be used together with from(String). The default value isfalse.- Parameters:
randomFromNumber-trueto use a random number instead of from(String).- Returns:
- This builder.
- Since:
- 8.2.0
-
ringbackTone
A URL value that points to a ringback tone to be played back on repeat to the caller, so they don't hear silence. The tone will automatically stop playing when the call is fully connected. It's not recommended to use this parameter when connecting to a phone endpoint, as the carrier will supply their own ringback tone.- Parameters:
ringbackTone- The ringback tone URL as a string.- Returns:
- This builder.
- Since:
- 8.2.0
-
build
Builds the ConnectAction.- Returns:
- A new
ConnectActionobject from the stored builder options.
-