setup an IVR with Asterisk

Sebastian picture Sebastian · Jan 30, 2009 · Viewed 23.5k times · Source

I need to setup a simple IVR system for a friend's company that will let the caller navigate through the menu by pressing phone keys. Its kind of like a bus schedule.

for today's schedule press '1', for tomorrow's schedule press '2' and so on.

It is solely an information system, i.e. no navigation route will end up with a real person but only audio messages will be played.

Now, I've never setup anything like this before and did a little digging on Google. Seems like I will be able to achieve this using Asterisk.

  • What else do I need hardware-wise?
  • Is a simple Linux server and a VOIP account with a provider in Germany sufficient?
  • Will a VPS handle the task?
  • How about multiple concurrent incoming calls?
  • Are those handled by Asterisk?

Answer

Quassnoi picture Quassnoi · Jan 30, 2009

It's perfectly possible.

What you need to know:

  1. Asterisk has some problems with H323. If your provider supplies SIP, ask them for SIP instead.

  2. You may build a whole IVR on dial plans in your extensions.conf, but for complex tasks it's better to use AGI. These are Perl or Python or whatever language scripts that implement your IVR logic. Each AGI session spans a child process, use FastAGI and a network daemon if you expect frequent connections.

  3. Multiple concurrent calls are not a problem, my installation of Asterisk on a simple PC handles hundreds sumultaneous calls.

  4. The only things that may really affect performance are sound conversion and tone detection.

    To improve performance, you should:

    1. Stick to one codec (µLaw is that I use), force all SIP connections to use that codec, and preconvert all your sound files to it using sox -t ul. As soon as you've done it, all Asterisk operation amounts to reading the file bytes from disk and sending them over network with just basic wrapping. There are no math, nothing except simple read-wrap-send operations.

    2. Ask your provider to detect tones on his side and send them to you out of band, using RFC 2833. Tone detection is quite a CPU consuming operation, let them do it theirselves.

    I personally run Asterisk on a 2,66 MHz Celeron IV with 2048 MB RAM, under Fedora 10 X86_64. 150 connections at once work OK, there are no delays.

    Overall traffic amounts to about 9.6 KByte/sec per connection. For a modern VPS there should be no problem at all.