System information

programmer but are very adept with Asterisk dialplans and databases, you’ll love
func_odbc just as much as we do. Check it out in Chapter 16.
AGI
The Asterisk Gateway Interface is such an important part of integrating external ap-
plications with Asterisk that we gave it its own chapter. You can find more information
in Chapter 21.
AMI
The Asterisk Manager Interface is a socket interface that you can use to get configura-
tion and status information, request actions to be performed, and get notified about
things happening to calls. We’ve written an entire chapter on AMI, as well. You can
find more information in Chapter 20.
A Simple IVR Using CURL
The GNU/Linux program cURL is useful for retrieving data from a URI. In Asterisk,
CURL() is a dialplan function.
We’re going to use CURL() as an example of what an extremely simple IVR can look
like. We’re going to request our external IP address from the website http://www.what
ismyip.org.
In reality, most IVR applications are going to be far more complex. Even
most uses of CURL() will tend to be complex, since a URI can return a
massive and highly variable amount of data, the vast majority of which
will be incomprehensible to Asterisk. The point being that an IVR is not
just about the dialplan; it is also very much about the external applica-
tions that are triggered by the dialplan, which are doing the real work
of the IVR.
Before you can use CURL(), you have to ensure it is installed.
Installing the cURL Module
Installing cURL is easy. If it was not on your system when you last compiled Asterisk,
after installing it you’ll need to recompile Asterisk so that it can locate the cURL de-
pendencies and compile the func_curl.so module.
On CentOS:
$ sudo yum -y install libcurl-devel
A Simple IVR Using CURL | 393