you will need an access code since XXXX can be anything within a NPA-NXX area, or almost anything.
In this example 9 is for outside calls and let's say internal DN's are in the 5XXXX and 6XXXX range. So 8 can do or anything for that matter. * or # would work but let's go with 8.
User will dial 8XXXX where the XXXX is the last 4 digits of the LD number you are trying to dial.
That will hit a translation pattern the will strip the 8 and add the 9.1xxx-xxx in front of the XXXX making a LD call.
That will match a route pattern and send the call out the appropriate gateway.
Yes they will need to dial 5 digits, but if they don't want to dial 12, 5 is much better.