[Asterisk-Users] Asterisk with PostgreSQL

Sam Tilders
Thu, 24 Jun 2004 06:27:46 -0000

On Thu, Jun 24, 2004 at 09:05:42PM +0800, Caleb Kow
wrote:
> Jun 24 21:20:53 ERROR[1074494336]: cdr_pgsql.c:299 my_load_module:
> cdr_pgsql: Reason: could not connect to server: Connection refused
>         Is the server running on host localhost and accepting
>         TCP/IP connections on port 5432?
>
> However, the strange thing is that when I try to connect to this
> database using the command prompt, it puts me through! :) Only when
> Asterisk tries to connect to the postgresql database does it not work.
> Any idea why this is happening?

Asterisk is trying to connect to the postgresql postmaster.

"netstat -na |grep 5432" should show a line with LISTEN, if it
does not then postgres is not accepting tcp connections.

postmaster needs the -i option to accept tcp connections.

The startup script, perhaps /etc/init.d/postgresql needs
the command line to pg_ctl add the -i option to
postmaster's command line. Something like:
/usr/bin/pg_ctl -p /usr/bin/postmaster -o '-p 5432 -i' start
with whatever other options are already there.

Then after a restart, asterisk should be able to connect to
postgres.

--
--
Sam Tilders
sam@jovianprojects.com.au
(Move to Jupiter)