diago icon indicating copy to clipboard operation
diago copied to clipboard

Using some VoIP clients where the SDP resolves to internal IPs cause one-way audio

Open andre-dialpad opened this issue 2 months ago • 1 comments

I've tried with linphone and Zoiper and could replicate the one-way-audio issue.

The server

Diago server running on GCP with on a public IP address.

	dg := diago.NewDiago(ua,
		// Attach the sip server.
		diago.WithServer(sipServer),

		// Attach the transport.
		diago.WithTransport(diago.Transport{
			Transport: "udp",

			BindHost: "0.0.0.0", // Listen in all interfaces
			BindPort: cfg.Port, // Same port for listen and external.

			ExternalHost: "145.1.1.1", // The public IP
			ExternalPort: cfg.Port,
		}))

Clients

Using linphone or zoiper(but can happen in others) on a LAN, when initiating a call we may get the following SDP on INVITE request body:

o=Z 0 2640807 IN IP4 10.6.13.138
s=Z
c=IN IP4 10.6.13.138
t=0 0
m=audio 36600 RTP/AVP 0 101 8 3
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=sendrecv
a=rtcp-mux

Diago

On diago in media/media_session.go on the method RemoteSDP() at some point this line appears:

// file media_session.go  MediaSession.RemoteSDP() method

 // more code
ci, err := sd.ConnectionInformation()
if err != nil {
  return err
}

// more code

// XXX At this point the remote address is set to whatever is on the SDP CI.
s.SetRemoteAddr(&net.UDPAddr{IP: ci.IP, Port: md.Port})

I have noticed that here, using the HOST of the contact header makes things work. I am not sure however that would be the right course of action.

andre-dialpad avatar Oct 16 '25 10:10 andre-dialpad

Hi @andre-dialpad . Welcome. Thanks for using project.

RTP symetric is one of feature missing. It will be added, but so far had no urgency todo this, or had request todo so. As alternative right now I suggest that you run sip/media proxy in front.

emiago avatar Oct 18 '25 07:10 emiago