Unless you have a very, very, very high tolerance for pain, you should be using Twilio. It abstracts away the entire telephony piece of that puzzle and lets you interface with it using, basically, standard web programming tricks, callbacks, and REST APIs. You don't have to worry about phone lines, concurrency (except as relates to a web application), etc.
Acceptable alternatives on the same model include Tropo and Plivo.
If you're dead-set on running your own telephone equipment, then get a book on Asterisk and may God have mercy on your soul.
(Context: I'm a boring ol' systems engineer who runs several hundred users sending thousands of messages a day from an only modestly complicated Rails app which uses Twilio. Up until a few days ago it fit comfortably on a 2 GB VPS. We use Twilio to provide users with numbers that they can call in and record messages on, and then we do interesting things to those recordings and then repurpose them in a scalable fashion.)