System information

systems, electrical grids, and Internet connections, the company can save a significant
amount of money by supporting remote employees. Additionally, those employees can
be located across the globe to expand the number of hours your agents are available,
thereby allowing you to serve more time zones.
Using this system is simple and efficient, but as the company grows, the system may
reach a capacity issue. We’ll look at how the system can be expanded later in this
chapter.
Asterisk and Database Integration
Integrating Asterisk with a database can add a great deal of functionality to your system.
Additionally, it provides a way to build web-based configuration utilities to make the
maintenance of an Asterisk system easier. What’s more, it allows instant access to
information from the dialplan and other parts of the Asterisk system.
Single Database
Adding database integration to Asterisk (Figure 22-4) is a powerful way of gaining
access to information that can be manipulated by other means. For example, we can
read information about the extensions and devices in the system from a database using
the Asterisk Realtime Architecture (discussed in Chapter 16), and we can modify the
information stored in the database via an external system, such as a web page.
The integration with the database adds a layer between Asterisk and the web interface
that the web designer is familiar with, and allows the manipulation of data in a way
that doesn’t require any additional skill sets. Knowledge of Asterisk itself is left to the
Asterisk administrator, and the web developer can happily work with tools she is
familiar with.
Of course, this makes the Asterisk system slightly more complex to build, but integra-
tion with a database via ODBC adds all sorts of possibilities (such as hot-desking,
discussed in “Getting Funky with func_odbc: Hot-Desking” on page 354). func_odbc
is a powerful tool for the Asterisk administrator, providing the ability to build a static
dialplan using data that is dynamic in nature. See Chapter 16 for more information
about how to integrate Asterisk with a database, and the functionality it provides.
We’re also quite fond of the func_curl module, which provides integration with web
services over HTTP directly from the dialplan.
With the data abstracted from Asterisk directly, we will now have an easier time moving
toward a system that is getting ready to be clustered. We can use something like Linux-
HA (http://www.linux-ha.org/wiki/Main_Page) to provide automatic failover between
systems. While in the event of a failure the calls on the system that failed will be lost,
the failover will take only moments (less than a second) to be detected, and the system
will appear to its users to be immediately available again. In this configuration, since
Asterisk and Database Integration | 493