From 201459f47f6957614b03abbe5c0fdc7a582d118c Mon Sep 17 00:00:00 2001 From: Denys Smirnov Date: Mon, 27 Nov 2023 18:08:26 +0200 Subject: [PATCH] Fix destination address (#4) Fix destination address. --- pkg/sip/media.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/sip/media.go b/pkg/sip/media.go index 180ea1e8..112a03fd 100644 --- a/pkg/sip/media.go +++ b/pkg/sip/media.go @@ -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"), @@ -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 }