-
Notifications
You must be signed in to change notification settings - Fork 32
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
Send analytics events #216
Conversation
pkg/sip/types.go
Outdated
@@ -60,15 +74,38 @@ const ( | |||
type URI struct { | |||
User string | |||
Host string | |||
Port uint16 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why adding a separate port, if it's already in Addr
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the Host field ends up containing a hostname and port, not an ip address, the Addr argument will be invalid (the preexisting line netip.AddrPortFrom(u.Addr.Addr(), uint16(port))
will return "Invalid AddPort", with no port field if u.Addr.Addr()
is invalid).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also thought that it's the case, but it will still work if we test port separately from the address. addrport.IsValid()
always returns addrport.Addr().IsValid()
.
But if you think it's inconvenient to use that separately, we could change the field type to netip.Addr
and add a AddrPort/SetAddrPort
helper methods.
pkg/sip/types.go
Outdated
url := &livekit.SIPUri{ | ||
User: u.User, | ||
Host: u.GetHost(), | ||
Port: fmt.Sprintf("%d", u.GetPort()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will change after updating to livekit/protocol#869
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. I'll update
No description provided.