Page 291 - Asterisk™: The Future of Telephony
P. 291
CHAPTER 12
Relational Database Integration
Few things are harder to put up with than the annoyance
of a good example.
—Mark Twain
Introduction
In this chapter we are going to explore integrating some Asterisk features and functions
into a database. There are several databases available for Linux, but we have chosen to
limit our discussion to PostgreSQL. While we acknowledge MySQL is also an extremely
popular database, we had to choose one, and our experience with PostgreSQL tipped
the scale in its favor. All that having been said, what we are actually going to be doing
is discussing the ODBC connector, so as long has you have familiarity with getting your
favorite database ODBC-ready, the substance of this chapter will apply to you.
Integrating Asterisk with databases is one of the fundamental elements allowing clus-
tering of Asterisk into a large, distributed system. By utilizing the power of the database,
dynamically changing data can convey information across an array of Asterisk systems.
Our newest favorite Asterisk function is func_odbc, which we will cover later in this
chapter.
While not all Asterisk deployments will require a relational database, understanding
how to harness them opens the lid of a treasure chest full of new ways to design your
telecom solution.
Installing the Database
The first thing to do is to install the PostgreSQL database server: *
# yum install -y postgresql-server
* On a large, busy system you will want to install this on a completely separate box from your Asterisk system.
263