You are probably looking for a combination of IVM and Axon.
IVM will handle incoming calls and answer them automatically, prompting the caller to choose options from a menu. It will also take care of voice mail and whatnot.
Axon will handle all the call routing for your business, sending the caller to the appropriate phone extension(s) or holding them in queue until someone is able to answer the call. It also connects to external VoIP lines.
Internally, each phone extension would be connected to Axon. This allows calls internally between extensions, and also allow for incoming/outgoing call from/to external parties.
Note that Axon is only compatible with VoIP telephone lines. If you wish to use traditional analogue lines, you'll need to purchase an FXO adaptor, or use NCH's carousel software in conjunction with a compatible telephony board.