public static class ConnectOptions.Builder extends CallOptions.Builder
ConnectOptions
.
All methods are optional.
Constructor and Description |
---|
Builder(String accessToken)
Use this Builder when making a
Call |
Modifier and Type | Method and Description |
---|---|
ConnectOptions |
build()
Builds
ConnectOptions object. |
ConnectOptions.Builder |
enableInsights(boolean enable)
Specify reporting statistics to Insights.
|
ConnectOptions.Builder |
iceOptions(IceOptions iceOptions)
Custom ICE configuration used to connect to a Call.
|
ConnectOptions.Builder |
params(Map<String,String> params)
Set the parameters that are passed to the TwiML application specified by the access token.
|
ConnectOptions.Builder |
preferAudioCodecs(List<AudioCodec> preferredAudioCodecs)
Set preferred audio codecs.
|
ConnectOptions.Builder |
region(String region)
Sets the region (Twilio data center) for the SDK.
|
public Builder(String accessToken)
Call
The identity provided in the Access Token may only contain alpha-numeric and underscore characters. Other characters, including spaces, will result in undefined behavior.
accessToken
- The accessToken that provides the identity and grants of the caller in a JSON Web Token(JWT) format.public ConnectOptions.Builder params(Map<String,String> params)
Parameters specified in this map will be provided as HTTP GET query params or as part of 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 to configure 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 TwiML Application.
public ConnectOptions.Builder iceOptions(IceOptions iceOptions)
public ConnectOptions.Builder enableInsights(boolean enable)
public ConnectOptions.Builder preferAudioCodecs(List<AudioCodec> preferredAudioCodecs)
The following snippet demonstrates how to prefer a single audio codec.
ConnectOptions connectOptions = new ConnectOptions.Builder(token)
.preferAudioCodecs(Collections.singletonList(new PcmuCodec()))
.build();
The following snippet demonstrates how to specify the exact order of codec preferences.
ConnectOptions connectOptions = new ConnectOptions.Builder(token)
.preferAudioCodecs(Arrays.asList(new PcmuCodec(), new OpusCodec()))
.build();
public ConnectOptions.Builder region(String region)
region
- The region.public ConnectOptions build()
ConnectOptions
object.3.3.0