Skip to content
Open
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
1 change: 1 addition & 0 deletions pkg/sip/inbound.go
Original file line number Diff line number Diff line change
Expand Up @@ -990,6 +990,7 @@ func (c *inboundCall) runMediaConn(tid traceid.ID, offerData []byte, enc livekit
logSignalChanges, _ = strconv.ParseBool(featureFlags[signalLoggingFeatureFlag])
mp, err := NewMediaPort(tid, c.log(), c.mon, &MediaOptions{
IP: c.s.sconf.MediaIP,
BindIP: c.s.sconf.SignalingIPLocal,
Ports: conf.RTPPort,
MediaTimeoutInitial: c.s.conf.MediaTimeoutInitial,
MediaTimeout: c.s.conf.MediaTimeout,
Expand Down
7 changes: 6 additions & 1 deletion pkg/sip/media_port.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ type MediaConf struct {

type MediaOptions struct {
IP netip.Addr
BindIP netip.Addr
Ports rtcconfig.PortRange
MediaTimeoutInitial time.Duration
MediaTimeout time.Duration
Expand Down Expand Up @@ -335,7 +336,11 @@ func NewMediaPortWith(tid traceid.ID, log logger.Logger, mon *stats.CallMonitor,
opts.Stats = &PortStats{}
}
if conn == nil {
c, err := rtp.ListenUDPPortRange(opts.Ports.Start, opts.Ports.End, netip.AddrFrom4([4]byte{0, 0, 0, 0}))
bindIP := opts.BindIP
if !bindIP.IsValid() {
bindIP = netip.AddrFrom4([4]byte{0, 0, 0, 0})
}
c, err := rtp.ListenUDPPortRange(opts.Ports.Start, opts.Ports.End, bindIP)
if err != nil {
return nil, err
}
Expand Down
1 change: 1 addition & 0 deletions pkg/sip/outbound.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ func (c *Client) newCall(ctx context.Context, tid traceid.ID, conf *config.Confi

call.media, err = NewMediaPort(tid, call.log, call.mon, &MediaOptions{
IP: c.sconf.MediaIP,
BindIP: c.sconf.SignalingIPLocal,
Ports: conf.RTPPort,
MediaTimeoutInitial: c.conf.MediaTimeoutInitial,
MediaTimeout: c.conf.MediaTimeout,
Expand Down