@@ -373,7 +373,11 @@ class SIPUAHelper extends EventManager {
373
373
'iceTransportPolicy' :
374
374
(_uaSettings? .iceTransportPolicy ?? IceTransportPolicy .ALL )
375
375
.toParameterString (),
376
- 'iceServers' : _uaSettings? .iceServers
376
+ 'iceServers' : _uaSettings? .iceServers,
377
+ 'tcpCandidatePolicy' :
378
+ (_uaSettings? .tcpCandidatePolicy ?? TcpCandidatePolicy .ENABLED )
379
+ .toParameterString (),
380
+ 'iceCandidatePoolSize' : _uaSettings? .iceCandidatePoolSize
377
381
},
378
382
'mediaConstraints' : < String , dynamic > {
379
383
'audio' : true ,
@@ -854,6 +858,19 @@ extension _IceTransportPolicyEncoding on IceTransportPolicy {
854
858
}
855
859
}
856
860
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
+
857
874
class UaSettings {
858
875
WebSocketSettings webSocketSettings = WebSocketSettings ();
859
876
TcpSocketSettings tcpSocketSettings = TcpSocketSettings ();
@@ -922,6 +939,18 @@ class UaSettings {
922
939
/// Will default to [IceTransportPolicy.ALL] if not specified.
923
940
IceTransportPolicy ? iceTransportPolicy;
924
941
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
+
925
954
/// Controls which kind of messages are to be sent to keep a SIP session
926
955
/// alive.
927
956
/// Defaults to "UPDATE"
0 commit comments