Skip to content

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

@andre-dialpad

Description

@andre-dialpad

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions