Package com.nexmo.client.voice.ncco
Class ConnectAction.Builder
- java.lang.Object
-
- com.nexmo.client.voice.ncco.ConnectAction.Builder
-
- Enclosing class:
- ConnectAction
public static class ConnectAction.Builder extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods 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)
-
-
-
Method Detail
-
endpoint
public ConnectAction.Builder endpoint(java.util.Collection<Endpoint> endpoint)
- Parameters:
endpoint- Connect the call to a specific #Endpoint.- Returns:
- The
ConnectAction.Builderto keep building.
-
endpoint
public ConnectAction.Builder endpoint(Endpoint... endpoint)
- Parameters:
endpoint- Connect the call to a specific #Endpoint.- Returns:
- The
ConnectAction.Builderto keep building.
-
from
public ConnectAction.Builder from(java.lang.String from)
- Parameters:
from- A number in E.164 format that identifies the caller.This must be one of your Nexmo virtual numbers, another value will result in the caller ID being unknown.
- Returns:
- The
ConnectAction.Builderto keep building.
-
eventType
public ConnectAction.Builder eventType(EventType 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
public ConnectAction.Builder timeOut(java.lang.Integer timeOut)
- Parameters:
timeOut- If the call is unanswered, set the number in seconds before Nexmo stops ringing endpoint. The default value is 60.- Returns:
- The
ConnectAction.Builderto keep building.
-
limit
public ConnectAction.Builder limit(java.lang.Integer 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
public ConnectAction.Builder machineDetection(MachineDetection machineDetection)
- Parameters:
machineDetection- Configure the behavior when Nexmo detects that a destination is an answerphone.Set to either:
-
MachineDetection.CONTINUENexmo sends an HTTP request to event_url with the Call event machine -
MachineDetection.HANGUPto end the Call
-
- Returns:
- The
ConnectAction.Builderto keep building.
-
eventUrl
public ConnectAction.Builder eventUrl(java.util.Collection<java.lang.String> eventUrl)
- Parameters:
eventUrl- Set the webhook endpoint that Nexmo 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
public ConnectAction.Builder eventUrl(java.lang.String... eventUrl)
- Parameters:
eventUrl- Set the webhook endpoint that Nexmo 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
public ConnectAction.Builder eventMethod(EventMethod eventMethod)
- Parameters:
eventMethod- The HTTP method Nexmo uses to make the request to eventUrl. The default value is POST.- Returns:
- The
ConnectAction.Builderto keep building.
-
build
public ConnectAction build()
- Returns:
- A new
ConnectActionobject from the stored builder options.
-
-