I helped my employer build a similar setup.
We have 3 POTS lines and have bought several other phone numbers/outgoing lines from Vitelity.com
. We are have server in the office running Trixbox
. Trixbox an entire Linux distro that puts a nice frontend management site to Asterisk. In the server we bought a Digium Analog card from voipsupply.com
. That card takes our analog lines. You can then setup dial plans for incoming and outgoing calls based on how you want calls to flow. i.e. outgoing phone calls should go out the Vitelity line so the analog line stays open for incoming calls.
For phones we are using Grandstream GXP-2020s. There are is a love/hate relationship with Grandstream phones but I happen to like them. They are cheap ($100) compared to Cisco and Polycom and with the latest firmware releases they are very stable.
It's a time consuming process to get it functioning the first time, but it's really flexible once it's working. Message me if you have questions.