Yesterday I had an interesting discussion with Bogdan-Andrei Iancu (OpenSIPS core developer) on #opensips IRC Channel (Freenode). Topic where clients frequently changing port in their REGISTER Contact headers as of STUN errors, caused either by braindead UACs, routers or admins.
After reflecting a while I had an keen idea on how to cleanly solve the issue. However, as also Bogdan has not been really sure whether it could work while maintaining RFC conformance, I decided to ask for feedback on SIP-Implementors mailinglist.
Here is what I wrote: