Avoid media proxy on both intra- and inter-location calls?

I have a FreePBX system, based on Asterisk 1.8, running on a VPS. If required, a version upgrade would be no problem. I’d like to interconnect three locations (and various VoIP providers), somehow avoiding having Asterisk in the media path.

Each location has IP desk phones (Polycom or Aastra) and a Gigaset A580 IP system. One place has a POTS line, connected by an SPA3102; another has pseudo-POTS (triple-play from ISP), connected via an OBi110. The ISP-supplied NAT router/modems can do port range forwarding, but hairpinning does not work correctly. The phones and ATAs can all do NAT mapping or not, whichever would work best in this system.

My dilemma:

If NAT mapping is off (devices send private address in SDP), directrtpsetup will work for intra-location calls (between extensions or to/from the local POTS), but will fail for inter-location calls. Trunk calls using a provider that does not proxy media (and whose upstreams don’t do symmetric RTP) will also fail. Conversely, if NAT mapping is on, inter-location is ok, but intra will fail.

Is there a way to get Asterisk to send (in the SDP) the endpoint’s private IP address when the peer is behind the same NAT, and send the public IP address otherwise? Or, is there another solution for this issue?