Voip and foip OUTGOING only?

Hello. I’m a software engineer, I can usually fill in the blanks, but I am new to voip, foip, etc and there are so many gaps in information Ive read and so many acronyms Ive not been able to solidly understand how it all works. Im hoping you all can help. Looking for basics here (equipment needed, expected subscriptions/services) not a full how to, I can rely on the training and books for that.

First, the scenario:
I have a product. We currently use 2 3rd party service (PHP web app using service APIs).
Twilio - we make calls from the web application via Twilio API to call normal 10ds and playback pre-recorded audio, then take a response from the end party, i.e, “press 1, 2 or 3”. Twilio returns what they pressed and we process. Twilio claims up to 500 concurrent calls, we will aim for just 50, and can start lower if possible and build to that number. Currently 2c/min
GreenFax - We use an api to send html and some other information (header, etc), Greenfax turns it into a fax and sends it off to a fax number. Concurrency is not as important, they can queue. Currently 7c/page

We would like to replace these services eventually with our own solution, to get to a flat fee and manageable solution. An open source solution is preferred. Ive found Asterisk, FreePBX, Elastix and some others, read through some information on voip/foip, but overall its either not clear whats required, or the information is more for call centers and the like where you would have phones attached/incoming calls.

I just need Call API->Fax/Call is made->Endpoint 10d receives fax, or call that plays back some pre-recorded stuff and gives them a choice that returns to my application.
I thought it was as simple as a server, with a piece of software like Asterisk, and the server having some sort of card hooked up to phone lines? internet connection?
If anyone could please enlighten and fill in the gaps, I’m happy to provide what I can from my end to further explain the goal as well.