@@ -373,7 +373,11 @@ class SIPUAHelper extends EventManager {
373373 'iceTransportPolicy' :
374374 (_uaSettings? .iceTransportPolicy ?? IceTransportPolicy .ALL )
375375 .toParameterString (),
376- 'iceServers' : _uaSettings? .iceServers
376+ 'iceServers' : _uaSettings? .iceServers,
377+ 'tcpCandidatePolicy' :
378+ (_uaSettings? .tcpCandidatePolicy ?? TcpCandidatePolicy .ENABLED )
379+ .toParameterString (),
380+ 'iceCandidatePoolSize' : _uaSettings? .iceCandidatePoolSize
377381 },
378382 'mediaConstraints' : < String , dynamic > {
379383 'audio' : true ,
@@ -854,6 +858,19 @@ extension _IceTransportPolicyEncoding on IceTransportPolicy {
854858 }
855859}
856860
861+ enum TcpCandidatePolicy { ENABLED , DISABLED }
862+
863+ extension _TcpCandidatePolicyEncoding on TcpCandidatePolicy {
864+ String toParameterString () {
865+ switch (this ) {
866+ case TcpCandidatePolicy .ENABLED :
867+ return 'enabled' ;
868+ case TcpCandidatePolicy .DISABLED :
869+ return 'disabled' ;
870+ }
871+ }
872+ }
873+
857874class UaSettings {
858875 WebSocketSettings webSocketSettings = WebSocketSettings ();
859876 TcpSocketSettings tcpSocketSettings = TcpSocketSettings ();
@@ -922,6 +939,18 @@ class UaSettings {
922939 /// Will default to [IceTransportPolicy.ALL] if not specified.
923940 IceTransportPolicy ? iceTransportPolicy;
924941
942+ /// Allows to disable tcp candidates gathering
943+ /// Will default to [TcpCandidatePolicy.ENABLED] if not specified.
944+ TcpCandidatePolicy ? tcpCandidatePolicy;
945+
946+ /// An unsigned 16-bit integer value which specifies the size of the prefetched
947+ /// ICE candidate pool. The default value is 0 (meaning no candidate prefetching will occur).
948+ /// You may find in some cases that connections can be established more quickly
949+ /// by allowing the ICE agent to start fetching ICE candidates before you start
950+ /// trying to connect, so that they're already available for inspection
951+ /// when RTCPeerConnection.setLocalDescription() is called.
952+ int iceCandidatePoolSize = 0 ;
953+
925954 /// Controls which kind of messages are to be sent to keep a SIP session
926955 /// alive.
927956 /// Defaults to "UPDATE"
0 commit comments