Installing the Database
The first thing to do is to install the PostgreSQL database server:[134]
# yum install -y postgresql-serverThen start the database, which will take a few seconds to initialize for the first time:
# service postgresql startNext, create a user called asterisk, which we will use to connect to and manage the database. Run the following commands:
#su - postgres$createuser -PEnter name of user to add:asteriskEnter password for new user:Enter it again:Shall the new role be a superuser? (y/n)nShall the new user be allowed to create databases? (y/n)yShall 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.
Read now
Unlock full access