We're toying with the idea of writing a new script for outbound calls to keep tenant-to-tenant calls on our network. I know eeman advocates having a sip router in front of the Thirdlane server to do this, and I understand his reasoning. But, I would like to come up with a decent solution until I can get the sip router idea in place.
Our idea is a new outbound dialing script that uses awk to parse /etc/asterisk/dids.txt for an outbound call. If the called number is in dids.txt the call should be another tenant on the same server. In that case we pull the tenant ID from dids.txt and put the call back into the correct context to keep it local.