Skip to content

Commit

Permalink
Fix destination address (#4)
Browse files Browse the repository at this point in the history
Fix destination address.
  • Loading branch information
dennwc authored Nov 27, 2023
1 parent 6f8b6b5 commit 201459f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pkg/sip/media.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ func (c *inboundCall) closeMedia() {
}

func (c *inboundCall) createMediaSession() (*net.UDPAddr, error) {
var rtpDestination atomic.Value
conn, err := net.ListenUDP("udp", &net.UDPAddr{
Port: 0,
IP: net.ParseIP("0.0.0.0"),
Expand All @@ -82,8 +81,8 @@ func (c *inboundCall) createMediaSession() (*net.UDPAddr, error) {
},
}
c.media.mix = mixer.NewMixer(func(audioSample []byte) {
dstAddr, ok := rtpDestination.Load().(*net.UDPAddr)
if !ok || dstAddr == nil {
dstAddr := c.media.dest.Load()
if dstAddr == nil {
return
}

Expand Down

0 comments on commit 201459f

Please sign in to comment.