[asterisk-users] Using unix socket to connect with database

Kevin P. Fleming kpfleming at digium.com
Fri May 21 16:55:28 CDT 2010


On 05/21/2010 02:48 AM, Deepesh D wrote:

> I am using asterisk realtime with a postgresql database on the same server.
> 
> In res_pgsql.conf I have specified
> [general]
> dbhost=localhost
> dbport=5432
> dbname=asteriskdb
> dbuser=psql
> dbsock=/tmp/.s.PGSQL.5432
> 
> Since both asterisk and db are on same server, I would like asterisk
> to connect to db using the local unix socket. However asterisk is not
> using the local unix socket to connect to database, it is making a tcp
> connection with the db. Is there anyway I can force asterisk to use
> the unix socket for db connection?

You've specified *both* a socket to be used and a hostname/port number.
The way the code is written, if both are supplied, the host/port
combination is used and the socket path is ignored. If you don't want
the host/port to be used, don't specify them.

-- 
Kevin P. Fleming
Digium, Inc. | Director of Software Technologies
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
skype: kpfleming | jabber: kfleming at digium.com
Check us out at www.digium.com & www.asterisk.org



More information about the asterisk-users mailing list