I have an Asterisk box with a public IP address and two SIP clients behind the same NAT device; I also have SIP clients behind different NATs. I want to know is it possible for Asterisk to detect if both clients are behind the same NAT and use direct media between them and use other options for clients that are behind different NATs?
PS:I assumed each NAT box has a single external IP address, and this assumption is good for me.
Asterisk 11.6 has this feature take a look at sip.conf.example and look for directmedia section.