I set this up a few years ago on a 500 for a nursing home customer of mine.

If its a iDCS or later then you can use the network lcr in the dial number plan.

Just put your local/std/idd codes in the table, then in network dial translation just put the same entry in, then do you lcr tables are per normal and away you go.

Just gotta make sure their extension range doesn't conflict with a real world phone number.