-
public class ConnectOptions.Builder extends CallOptions.Builder
Build new ConnectOptions.
All methods are optional.
-
-
Constructor Summary
Constructors Constructor Description ConnectOptions.Builder(String accessToken)Use this Builder when making a CallThe maximum number of characters for the identity provided in the token is 121.
-
Method Summary
Modifier and Type Method Description ConnectOptions.Builderparams(@NonNull() Map<String, String> params)Set the parameters that are passed to the TwiML application specified by the accesstoken. ConnectOptions.BuildericeOptions(@NonNull() IceOptions iceOptions)Custom ICE configuration used to connect to a Call. ConnectOptions.BuilderenableDscp(@NonNull() boolean enable)Enable DifferentiatedServices Field Code Point (DSCP) with Expedited Forwarding (EF). ConnectOptions.BuilderenableIceGatheringOnAnyAddressPorts(@NonNull() boolean enable)Enable gathering of ICE candidates on "any address" ports. ConnectOptions.BuilderpreferAudioCodecs(@NonNull() List<AudioCodec> preferredAudioCodecs)Set preferred audio codecs. ConnectOptions.BuildercallMessageListener(@NonNull() Call.CallMessageListener callMessageListener)Set the handler for receiving call messages. ConnectOptions.BuilderaudioOptions(@NonNull() AudioOptions audioOptions)Set the audio options for audio processing when making an outbound call. ConnectOptionsbuild()Builds ConnectOptions object. -
-
Constructor Detail
-
ConnectOptions.Builder
ConnectOptions.Builder(String accessToken)
Use this Builder when making a CallThe maximum number of characters for the identity provided in the token is 121.- Parameters:
accessToken- The accessToken that provides the identity and grants of the caller ina JSON Web Token(JWT) format.
-
-
Method Detail
-
params
@NonNull() ConnectOptions.Builder params(@NonNull() Map<String, String> params)
Set the parameters that are passed to the TwiML application specified by the accesstoken.
Parameters specified in this map will be provided as HTTP GET query params or as partof the HTTP POST body to the request url specified in your TwiML Application(https://www.twilio.com/console/voice/twiml/apps). These parameters can be used toconfigure the behavior of your call within the context of your TwiML Application.
NOTE: The Voice SDK URI encodes the parameters before passing them to your TwiMLApplication.
-
iceOptions
@NonNull() ConnectOptions.Builder iceOptions(@NonNull() IceOptions iceOptions)
Custom ICE configuration used to connect to a Call.
-
enableDscp
@NonNull() ConnectOptions.Builder enableDscp(@NonNull() boolean enable)
Enable DifferentiatedServices Field Code Point (DSCP) with Expedited Forwarding (EF).
- Parameters:
enable- Enable DSCP.
-
enableIceGatheringOnAnyAddressPorts
@NonNull() ConnectOptions.Builder enableIceGatheringOnAnyAddressPorts(@NonNull() boolean enable)
Enable gathering of ICE candidates on "any address" ports. When this flag is set, portsnot bound to any specific network interface will be used, in addition to normal portsbound to the enumerated interfaces. This flag may need to be set to support certainnetwork configurations (e.g. some VPN implementations) where ports are not bound tospecific interfaces. Setting this flag means that additional candidates might need to begathered and evaluated, which could lead to slower ICE connection times for regularnetworks.
- Parameters:
enable- Enable ICE candidates on "any address" ports.
-
preferAudioCodecs
@NonNull() ConnectOptions.Builder preferAudioCodecs(@NonNull() List<AudioCodec> preferredAudioCodecs)
Set preferred audio codecs. The list specifies which audio codecs would be preferred whennegotiating audio with the backend service. The preferences are applied in the orderfound in the list starting with the most preferred audio codec to the least preferredaudio codec. Audio codec preferences are not guaranteed to be satisfied because thebackend service is not guaranteed to support all audio codecs.
The following snippet demonstrates how to prefer a single audio codec.
ConnectOptions connectOptions = new ConnectOptions.Builder(token) .preferAudioCodecs(Collections.<AudioCodec>singletonList(new PcmuCodec())) .build();The following snippet demonstrates how to specify the exact order of codecpreferences.
ConnectOptions connectOptions = new ConnectOptions.Builder(token) .preferAudioCodecs(Arrays.asList(new PcmuCodec(), new OpusCodec())) .build();
-
callMessageListener
@NonNull() ConnectOptions.Builder callMessageListener(@NonNull() Call.CallMessageListener callMessageListener)
Set the handler for receiving call messages.
-
audioOptions
@NonNull() ConnectOptions.Builder audioOptions(@NonNull() AudioOptions audioOptions)
Set the audio options for audio processing when making an outbound call.
- Parameters:
audioOptions- - An AudioOptions object.
-
build
@NonNull() ConnectOptions build()
Builds ConnectOptions object.
-
-
-
-