Dialing a 7 digit extension

I have setup 2 extensions that are 7 digits like their DID. I want the users to be able to call each other by dialing the 7 digit number and not having to do anything else like dial 9 first, etc.

However, when a user tries to dial the other user, the call is routed out the trunk which of course comes right back in.

How can I setup to avoid this situation and have the extensions be able to dial each other directly?