Hello everyone,
I’m troubleshooting some SIP/WebRTC NAT issues and came across something odd.
When using a WebRTC client, ICE negotiation correctly returns a public IP in the SDP offer, and everything works as expected. However, when I use MicroSIP (with ICE enabled), the SDP includes a private/internal IP instead.
As can be seen here in rtp set debug on
Sent RTP packet to {MY PUBLIC IP}:55473 (via ICE) (type 09, seq 023994, ts 000080, len 000090)
Got RTP packet from {MY PUBLIC IP}:55473 (type 09, seq 030619, ts 3340734212, len 000170)
MicroSIp With ICE enabled:
Sent RTP packet to 192.168.1.77:4035 (type 00, seq 006999, ts 005920, len 000160)
With ICE disabled:
Got RTP packet from {MY PUBLIC IP}:4002 (type 00, seq 009740, ts 039040, len 000160)
Sent RTP packet to {MY PUBLIC IP}:4002 (type 00, seq 007840, ts 011200, len 000160)
As a result, audio fails in the MicroSIP when ICE is enabled.
Question
Why does ICE behave differently between these two clients? Shouldn’t both be able to discover and advertise the public IP if ICE is working properly? Both are running In my machine.
Any insight would be greatly appreciated!
Note: I’ve added the following to rtp.conf to help with NAT and both endpoints have ice_support=yes:
[ice_host_candidates]
172.19.0.5 => {Azure VM PUBLIC_IP}
Where 172.19.0.5 is a Docker internal IP that is used when SDP is exchange when I don’t have [ice_host_candidates] configured.
Thank you!