Skip to content

Add Advertising / Reading ICE trickle support #3097

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions offeransweroptions.go
Original file line number Diff line number Diff line change
Expand Up @@ -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" 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
Expand Down
10 changes: 9 additions & 1 deletion peerconnection.go
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,10 @@
return SessionDescription{}, err
}

if options.ICETricklingSupported {
descr.WithICETrickleAdvertised()

Check failure on line 722 in peerconnection.go

View workflow job for this annotation

GitHub Actions / test (1.24) / Go 1.24

descr.WithICETrickleAdvertised undefined (type *sdp.SessionDescription has no field or method WithICETrickleAdvertised)

Check failure on line 722 in peerconnection.go

View workflow job for this annotation

GitHub Actions / test (1.24) / Go 1.24

descr.WithICETrickleAdvertised undefined (type *sdp.SessionDescription has no field or method WithICETrickleAdvertised)

Check failure on line 722 in peerconnection.go

View workflow job for this annotation

GitHub Actions / test (1.23) / Go 1.23

descr.WithICETrickleAdvertised undefined (type *sdp.SessionDescription has no field or method WithICETrickleAdvertised)

Check failure on line 722 in peerconnection.go

View workflow job for this annotation

GitHub Actions / test (1.23) / Go 1.23

descr.WithICETrickleAdvertised undefined (type *sdp.SessionDescription has no field or method WithICETrickleAdvertised)

Check failure on line 722 in peerconnection.go

View workflow job for this annotation

GitHub Actions / lint / Go

descr.WithICETrickleAdvertised undefined (type *sdp.SessionDescription has no field or method WithICETrickleAdvertised)

Check failure on line 722 in peerconnection.go

View workflow job for this annotation

GitHub Actions / lint / Go

descr.WithICETrickleAdvertised undefined (type *sdp.SessionDescription has no field or method WithICETrickleAdvertised)
}

offer = SessionDescription{
Type: SDPTypeOffer,
SDP: string(sdpBytes),
Expand Down Expand Up @@ -836,7 +840,7 @@
// 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 {
Expand Down Expand Up @@ -876,6 +880,10 @@
return SessionDescription{}, err
}

if options.ICETricklingSupported {
descr.WithICETrickleAdvertised()

Check failure on line 884 in peerconnection.go

View workflow job for this annotation

GitHub Actions / test (1.24) / Go 1.24

descr.WithICETrickleAdvertised undefined (type *sdp.SessionDescription has no field or method WithICETrickleAdvertised)

Check failure on line 884 in peerconnection.go

View workflow job for this annotation

GitHub Actions / test (1.24) / Go 1.24

descr.WithICETrickleAdvertised undefined (type *sdp.SessionDescription has no field or method WithICETrickleAdvertised)

Check failure on line 884 in peerconnection.go

View workflow job for this annotation

GitHub Actions / test (1.23) / Go 1.23

descr.WithICETrickleAdvertised undefined (type *sdp.SessionDescription has no field or method WithICETrickleAdvertised)

Check failure on line 884 in peerconnection.go

View workflow job for this annotation

GitHub Actions / test (1.23) / Go 1.23

descr.WithICETrickleAdvertised undefined (type *sdp.SessionDescription has no field or method WithICETrickleAdvertised)

Check failure on line 884 in peerconnection.go

View workflow job for this annotation

GitHub Actions / lint / Go

descr.WithICETrickleAdvertised undefined (type *sdp.SessionDescription has no field or method WithICETrickleAdvertised)) (typecheck)

Check failure on line 884 in peerconnection.go

View workflow job for this annotation

GitHub Actions / lint / Go

descr.WithICETrickleAdvertised undefined (type *sdp.SessionDescription has no field or method WithICETrickleAdvertised)) (typecheck)
}

desc := SessionDescription{
Type: SDPTypeAnswer,
SDP: string(sdpBytes),
Expand Down
Loading