login | register
Wed 03 of Dec, 2008 [06:37 UTC]

voip-info.org

History

SER module postgres

Created by: stan,Last modification on Sat 19 of Nov, 2005 [21:19 UTC] by bmacleod
You may have to recompile (open)SER to get the postgres.so module.

make include_modules="postgres"


A minimal postgresql setup:


$ createdb ser
$ psql -U postgres ser
ser=# CREATE TABLE subscriber (
 username varchar(32),
 domain varchar(32),
 password varchar(16),
 PRIMARY KEY (username, domain)
);
ser=# create user ser with password 'mypass';
ser=# grant all on table subscriber to ser;


and to add users manually


ser=# insert into subscriber values ('user', 'domain_or_realm', 'pass');


make sure these are in ser.cfg


loadmodule "/usr/lib/ser/modules/postgres.so"
loadmodule "/usr/lib/ser/modules/usrloc.so"
loadmodule "/usr/lib/ser/modules/auth.so"
loadmodule "/usr/lib/ser/modules/auth_db.so"
modparam("usrloc", "db_mode", 0) # not using postgresql for usrloc database, in memory only
modparam("auth_db", "calculate_ha1", 1)
modparam("auth_db", "password_column", "password")
modparam("auth_db","db_url", "sql://ser:mypass@localhost:5432/ser")


Please note that later versions (=> 0.9.x) of SER require a change to the db_url:

modparam("auth_db","db_url", "postgres://ser:mypass@localhost:5432/ser")


mailing list posts with more information:
http://mail.iptel.org/pipermail/serusers/2003-July/001997.html
http://mail.iptel.org/pipermail/serusers/2003-November/003773.html

SER admin guide
auth_db README


Comments

Comments Filter
222

333Re: ident sameuser

by pupeno, Wednesday 29 of March, 2006 [17:39:49 UTC]
It was solved by connecting to the socket instead of the host, I've achieve that by replacing the URL with postgres://pupeno@/ser (PostgreSQL connects to the local socket by default).
222

333ident sameuser

by pupeno, Wednesday 29 of March, 2006 [16:23:57 UTC]
There's an awesome feature of postgresql where you authenticate only by being logged in as a particular user. I am using that so I don't have to type any password either by running the sql command line interface or in any configuration file.
But when I configure it to connect to postgresql it seems it doesn't even try to log in unless there's a password, because I get this error:
0(17038) ERROR: pg_con.c:164: postgres:new_connection: fe_sendauth: no password supplied
0(17038) ERROR:domain:connect_db: Unable to connect database postgres://pupeno@127.0.0.1/ser
222

333Module

by Kuehner, Thursday 23 of June, 2005 [12:32:07 UTC]
Where can I get the postgresql-module. I can't find it anywhere...
222

333where is postgres.so?

by jprosser, Monday 20 of September, 2004 [03:38:12 UTC]
It doesn't appear to be in the latest dist (for linux at least)

222

333Complete migration?

by dfilion, Thursday 16 of September, 2004 [22:33:30 UTC]
Is it possible to completely migrate SER to PostgreSQL?
222

333ser 0.8.14

by , Monday 16 of August, 2004 [22:26:22 UTC]
(:exclaim:) Do you have the script for creating tables with PostgreSQL using ser version 0.8.14???