Skip to content

Commit

Permalink
Merge pull request #16 from hydah/update-ice-config
Browse files Browse the repository at this point in the history
support ice configuration in global
  • Loading branch information
notedit authored Jun 12, 2023
2 parents 13b1be0 + 5e73f4f commit 2a62954
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
6 changes: 6 additions & 0 deletions sdpinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -846,6 +846,12 @@ func Parse(sdp string) (*SDPInfo, error) {

ufrag := md.IceUfrag
pwd := md.IcePwd
if ufrag == "" && sdpMap.IceUfrag != "" {
ufrag = sdpMap.IceUfrag
}
if pwd == "" && sdpMap.IcePwd != "" {
pwd = sdpMap.IcePwd
}

sdpInfo.SetICE(NewICEInfo(ufrag, pwd))

Expand Down
10 changes: 6 additions & 4 deletions transform/sdpstruct.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ type SsrcGroupStruct struct {
}

type SsrcStruct struct {
Id uint `json:"id,omitempty"`
Id uint `json:"id,omitempty"`
Attribute string `json:"attribute,omitempty"`
Value string `json:"value,omitempty"`
}
Expand Down Expand Up @@ -158,11 +158,13 @@ type SdpStruct struct {
Media []*MediaStruct `json:"media,omitempty"`
Fingerprint *FingerprintStruct `json:"fingerprint,omitempty"`
Connection *ConnectionStruct `json:"connection,omitempty"`
IceUfrag string `json:"iceUfrag,omitempty"`
IcePwd string `json:"icePwd,omitempty"`
Icelite string `json:"icelite,omitempty"`
}

type SctpMapStuct struct {
Port int `json:"sctpmapNumber"`
App string `json:"app"`
MessageSize int `json:"maxMessageSize"`
Port int `json:"sctpmapNumber"`
App string `json:"app"`
MessageSize int `json:"maxMessageSize"`
}

0 comments on commit 2a62954

Please sign in to comment.