Package com.vonage.client.voice.ncco
Class ConnectAction.Builder
java.lang.Object
com.vonage.client.voice.ncco.ConnectAction.Builder
- Enclosing class:
- ConnectAction
public static class ConnectAction.Builder extends java.lang.Object
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description ConnectActionbuild()ConnectAction.Builderendpoint(Endpoint... endpoint)ConnectAction.Builderendpoint(java.util.Collection<Endpoint> endpoint)ConnectAction.BuildereventMethod(EventMethod eventMethod)ConnectAction.BuildereventType(EventType eventType)ConnectAction.BuildereventUrl(java.lang.String... eventUrl)ConnectAction.BuildereventUrl(java.util.Collection<java.lang.String> eventUrl)ConnectAction.Builderfrom(java.lang.String from)ConnectAction.Builderlimit(java.lang.Integer limit)ConnectAction.BuildermachineDetection(MachineDetection machineDetection)ConnectAction.BuildertimeOut(java.lang.Integer timeOut)
-
Constructor Details
-
Method Details
-
endpoint
- Parameters:
endpoint- Connect the call to a specific #Endpoint.- Returns:
- The
ConnectAction.Builderto keep building.
-
endpoint
- Parameters:
endpoint- Connect the call to a specific #Endpoint.- Returns:
- The
ConnectAction.Builderto keep building.
-
from
- Parameters:
from- A number in E.164 format that identifies the caller.This must be one of your Vonage virtual numbers, another value will result in the caller ID being unknown.
- Returns:
- The
ConnectAction.Builderto keep building.
-
eventType
- Parameters:
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.
- Returns:
- The
ConnectAction.Builderto keep building.
-
timeOut
- Parameters:
timeOut- If the call is unanswered, set the number in seconds before Vonage stops ringing endpoint. The default value is 60.- Returns:
- The
ConnectAction.Builderto keep building.
-
limit
- Parameters:
limit- Maximum length of the call in seconds. The default and maximum value is 7200 seconds (2 hours).- Returns:
- The
ConnectAction.Builderto keep building.
-
machineDetection
- Parameters:
machineDetection- Configure the behavior when Vonage detects that a destination is an answerphone.Set to either:
-
MachineDetection.CONTINUEVonage sends an HTTP request to event_url with the Call event machine -
MachineDetection.HANGUPto end the Call
-
- Returns:
- The
ConnectAction.Builderto keep building.
-
eventUrl
- Parameters:
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.- Returns:
- The
ConnectAction.Builderto keep building.
-
eventUrl
- Parameters:
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.- Returns:
- The
ConnectAction.Builderto keep building.
-
eventMethod
- Parameters:
eventMethod- The HTTP method Vonage uses to make the request to eventUrl. The default value is POST.- Returns:
- The
ConnectAction.Builderto keep building.
-
build
- Returns:
- A new
ConnectActionobject from the stored builder options.
-