There is an entire dial plan design documented in the UCM 7.1 SRND for this. Learning and implementing it for the first time is no trivial matter. There are some additional resources such as an Advanced Dial Plan Design session recording from Cisco Live 2009 that help to clarify some of things the SRND doesn't mention.
Unfortunately, I have not seen a fully functional, finished example design documented anywhere by Cisco. To do this you will either need to find a partner who does this for a living and has already figured out all of gaps in the documentation; or, spend some time studying and working through it yourself.
Once you get it, it is a great design and has a ton of advantages. It just requires some work to learn.