Disclaimer first, I have done multiple bouts in the VOIP business as an employee, mentor, integrator, and shareholder. Our services side also sells/installs/custom configures managed voice solutions.
Now let me say that I don't want any business - only to give some further suggestions about doing this, however you choose to do this.
You can take local POTS lines and connect that to an open-source PBX in your local network - requires some interfaces, but do-able. Managed Voice means that the calls will arrive at your office(s) as data traffic. While there are folks on the boards here who could run their own PBX, I'm guessing most won't.
However you cut it, local network design/management is essential. VLANing the traffic is pretty much a minimum level to get acceptable performance. If you can physically segment the traffic, even better.
Next item is a edge device that supports QOS. A better organization will suggest/require an edge device that not only supports QOS, but also measures voice network traffic performance so that they can remotely monitor your voice network.
To be clear, SIP signaling is TCP/IP traffic, whereas the voice traffic is UDP, and UDP is much more sensitive to packet collisions, traffic congestion. The differences are a whole lesson in themselves, but VOIP doesn't not like burst traffic [like AC]. This I know from experience.
There are so many things that you can do with a well implemented VOIP system.
There are standard PBXs, Call Queues where calls are parked in order, and hybrid systems that have a front-side IVR, a call queue, as well as the means to exit the queue.
If anyone has more questions about VOIP, functionality, networking, or anything else - just post here, and I'll try and stop in multiple times this week.
If you are really itching to cook your own, just post that, and I'll dig up some starter links.
I actually have a whole course I wrote about implementing VOIP, but that was 11 years ago, so I'm sure there is better info now.