Skip to Content
Asterisk: The Future of Telephony, 2nd Edition
book

Asterisk: The Future of Telephony, 2nd Edition

by Jim Van Meggelen, Jared Smith, Leif Madsen
August 2007
Intermediate to advanced
608 pages
20h 33m
English
O'Reilly Media, Inc.
Content preview from Asterisk: The Future of Telephony, 2nd Edition

Installing the Database

The first thing to do is to install the PostgreSQL database server:[134]

# yum install -y postgresql-server

Then start the database, which will take a few seconds to initialize for the first time:

# service postgresql start

Next, create a user called asterisk, which we will use to connect to and manage the database. Run the following commands:

# su - postgres
$ createuser -P
Enter name of user to add: asterisk
Enter password for new user: 
Enter it again: 
Shall the new role be a superuser? (y/n) n
Shall the new user be allowed to create databases? (y/n) y
Shall the new user be allowed to create more new users? (y/n)nCREATE USER

By default, PostgreSQL does not listen on the TCP/IP connection, which Asterisk will be using. We need to modify the /var/lib/pgsql/data/postgresql.conf file in order to allow Asterisk to make IP connections to the database. To do this, simply remove the comment from the beginning of the tcpip_socket and port parameters. Be sure to change the tcpip_socket option from false to true.

tcpip_socket = true max_connections = 100
        # note: increasing max_connections costs about 500 bytes of shared
        # memory per connection slot, in addition to costs from shared_buffers
        # and max_locks_per_transaction.
#superuser_reserved_connections = 2
port = 5432

Now, edit the /var/lib/pgsql/data/pg_hba.conf file in order to allow the asterisk user we just created to connect to the PostgreSQL server over the TCP/IP socket. At the end of the file, replace everything ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Asterisk: The Future of Telephony

Asterisk: The Future of Telephony

Jim Van Meggelen, Jared Smith, Leif Madsen
Switching to VoIP

Switching to VoIP

Theodore Wallingford

Publisher Resources

ISBN: 9780596510480Errata Page