Package 

Class ConnectOptions.Builder

    • 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.

      • 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();