I configured a trunk between two Asterisk boxes. The one is behind a NAT and was able to register to the other with no problem, but calls failed with a cryptic message that DNS resolution for "(null)" failed. Looking at a SIP packet capture, I saw something to this effect:
Well yeah, I could see how that would cause a problem, but where did "(null)" come from?
Simple answer, really. The side sending the "(null)" did not have TCP enabled and I had set "transport=tcp" on the peer.
asterisk*CLI> sip show settings
TCP SIP Bindaddress: Disabled
The solution is a quick one: add "tcpenable=yes" to sip.conf and reload. Worked like a charm after that.