Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 2 additions & 0 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ type Config struct {
NAT1To1IP string `yaml:"nat_1_to_1_ip"`
ListenIP string `yaml:"listen_ip"`

// ENABLE JUMBO FRAME FOR UDP
UDPJumboFrame bool `yaml:"udp_jumbo_frame"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just expose it as udp_mtu_size instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There’s not much point in managable limit, since it only skipping the packet and logging an error. And there’s no handler for managing oversized data anyway.
Also, keep in mind how the transport package uses this value — it currently subtracts 200 from the initial limit, so you don’t have full control if the package changes in the future.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I renamed it to UDPMaxPayload to indicate that it's not an MTU specifically. We may use it later and propagate it down to the sipgo package.

// if different from signaling IP
MediaUseExternalIP bool `yaml:"media_use_external_ip"`
MediaNAT1To1IP string `yaml:"media_nat_1_to_1_ip"`
Expand Down
5 changes: 5 additions & 0 deletions pkg/sip/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"crypto/tls"
"errors"
"fmt"
"github.com/livekit/sipgo/transport"
"io"
"log/slog"
"net"
Expand Down Expand Up @@ -73,6 +74,10 @@ func NewService(region string, conf *config.Config, mon *stats.Monitor, log logg
if log == nil {
log = logger.GetLogger()
}
if conf.UDPJumboFrame {
transport.UDPMTUSize = 10000
}

if conf.MediaTimeout <= 0 {
conf.MediaTimeout = defaultMediaTimeout
}
Expand Down