Package com.twilio.voice
Class AcceptOptions.Builder
java.lang.Object
com.twilio.voice.CallOptions.Builder
com.twilio.voice.AcceptOptions.Builder
- Enclosing class:
- AcceptOptions
Build new
AcceptOptions
.
All methods are optional.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
BuildsAcceptOptions
object.callMessageListener
(Call.CallMessageListener callMessageListener) Set the handler for receiving call messages.enableDscp
(boolean enable) Enable Differentiated Services Field Code Point (DSCP) with Expedited Forwarding (EF).enableIceGatheringOnAnyAddressPorts
(boolean enable) Enable gathering of ICE candidates on "any address" ports.iceOptions
(IceOptions iceOptions) Custom ICE configuration used to connect to a Call.preferAudioCodecs
(List<AudioCodec> preferredAudioCodecs) Set preferred audio codecs.
-
Constructor Details
-
Builder
public Builder()Use this Builder when accepting aCallInvite
-
-
Method Details
-
iceOptions
Custom ICE configuration used to connect to a Call. -
enableDscp
Enable Differentiated Services Field Code Point (DSCP) with Expedited Forwarding (EF).- Parameters:
enable
- Enable DSCP. Defaults totrue
.
-
enableIceGatheringOnAnyAddressPorts
Enable gathering of ICE candidates on "any address" ports. When this flag is set, ports not bound to any specific network interface will be used, in addition to normal ports bound to the enumerated interfaces. This flag may need to be set to support certain network configurations (e.g. some VPN implementations) where ports are not bound to specific interfaces. Setting this flag means that additional candidates might need to be gathered and evaluated, which could lead to slower ICE connection times for regular networks.- Parameters:
enable
- Enable ICE candidates on "any address" ports. Defaults tofalse
.
-
preferAudioCodecs
@NonNull public AcceptOptions.Builder preferAudioCodecs(@NonNull List<AudioCodec> preferredAudioCodecs) Set preferred audio codecs. The list specifies which audio codecs would be preferred when negotiating audio with the backend service. The preferences are applied in the order found in the list starting with the most preferred audio codec to the least preferred audio codec. Audio codec preferences are not guaranteed to be satisfied because the backend service is not guaranteed to support all audio codecs.The following snippet demonstrates how to prefer a single audio codec.
AcceptOptions acceptOptions = new AcceptOptions.Builder(token) .preferAudioCodecs(Collections.<AudioCodec>singletonList(new PcmuCodec())) .build();
The following snippet demonstrates how to specify the exact order of codec preferences.
AcceptOptions acceptOptions = new AcceptOptions.Builder(token) .preferAudioCodecs(Arrays.asList(new PcmuCodec(), new OpusCodec())) .build();
-
callMessageListener
@NonNull public AcceptOptions.Builder callMessageListener(@NonNull Call.CallMessageListener callMessageListener) Set the handler for receiving call messages. -
build
BuildsAcceptOptions
object.
-