From e1ee0062ff1faa98aaee5513ddf0090047452d07 Mon Sep 17 00:00:00 2001 From: Srayan Jana Date: Sun, 13 Apr 2025 14:51:48 -0700 Subject: [PATCH 1/3] Add ice trickling supported bool --- offeransweroptions.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/offeransweroptions.go b/offeransweroptions.go index 17435566a29..6119d9e048c 100644 --- a/offeransweroptions.go +++ b/offeransweroptions.go @@ -9,6 +9,10 @@ type OfferAnswerOptions struct { // VoiceActivityDetection allows the application to provide information // about whether it wishes voice detection feature to be enabled or disabled. VoiceActivityDetection bool + // ICETricklingSupported indicates whether the ICE agent should use trickle ICE + // If set, the "a=ice-options:trickle ice2" attribute is added to the generated SDP payload. + // (See https://datatracker.ietf.org/doc/html/rfc9725#section-4.3.3) + ICETricklingSupported bool } // AnswerOptions structure describes the options used to control the answer From d8926a46902410eea5e76baf24ad3914f27945a5 Mon Sep 17 00:00:00 2001 From: Srayan Jana Date: Mon, 14 Apr 2025 19:47:40 -0700 Subject: [PATCH 2/3] Set up how options will work with ice trickle --- peerconnection.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/peerconnection.go b/peerconnection.go index a2d1a7afb77..e9db1f5775e 100644 --- a/peerconnection.go +++ b/peerconnection.go @@ -718,6 +718,10 @@ func (pc *PeerConnection) CreateOffer(options *OfferOptions) (SessionDescription return SessionDescription{}, err } + if options.ICETricklingSupported { + descr.WithICETrickleAdvertised() + } + offer = SessionDescription{ Type: SDPTypeOffer, SDP: string(sdpBytes), @@ -836,7 +840,7 @@ func (pc *PeerConnection) createICETransport() *ICETransport { // CreateAnswer starts the PeerConnection and generates the localDescription. // //nolint:cyclop -func (pc *PeerConnection) CreateAnswer(*AnswerOptions) (SessionDescription, error) { +func (pc *PeerConnection) CreateAnswer(options *AnswerOptions) (SessionDescription, error) { useIdentity := pc.idpLoginURL != nil remoteDesc := pc.RemoteDescription() switch { @@ -876,6 +880,10 @@ func (pc *PeerConnection) CreateAnswer(*AnswerOptions) (SessionDescription, erro return SessionDescription{}, err } + if options.ICETricklingSupported { + descr.WithICETrickleAdvertised() + } + desc := SessionDescription{ Type: SDPTypeAnswer, SDP: string(sdpBytes), From db600ce477c3fa765bdb30a7563bb9f37a35f9f3 Mon Sep 17 00:00:00 2001 From: Srayan Jana Date: Tue, 15 Apr 2025 19:16:06 -0700 Subject: [PATCH 3/3] remove ice2 --- offeransweroptions.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/offeransweroptions.go b/offeransweroptions.go index 6119d9e048c..2bc6352ab29 100644 --- a/offeransweroptions.go +++ b/offeransweroptions.go @@ -10,7 +10,7 @@ type OfferAnswerOptions struct { // about whether it wishes voice detection feature to be enabled or disabled. VoiceActivityDetection bool // ICETricklingSupported indicates whether the ICE agent should use trickle ICE - // If set, the "a=ice-options:trickle ice2" attribute is added to the generated SDP payload. + // If set, the "a=ice-options:trickle" attribute is added to the generated SDP payload. // (See https://datatracker.ietf.org/doc/html/rfc9725#section-4.3.3) ICETricklingSupported bool }