I found the problem. My LAN router had the very helpful SIP application gateway setting turned on. This was changing the IP addresses in some, but not all, SIP messages that passed through it - and only from UDP.