Код: Выделить всё
######### install postgresql server #############
sudo yum install postgresql-server
yum install postgresql-devel
yum install postgresql-plperl
service postgresql initdb
service postgresql start
/etc/group can find new user postgres
(user postgres have own profile, own home direcory, but he haven't password)
sudo su postgres
//start pg db sql client
bash-4.1$ psql
//show help
help
//show databases
postgres-# \list
//exit from sql client
postgres-# \q
//set password for user postgres
postgres=# ALTER ROLE postgres WITH password 'postpassword';
######### http://alexxkn.ru/node/42
//allow only authorized connection
nano /var/lib/pgsql/data/pg_hba.conf
local all all md5
host all all 127.0.0.1/32 md5
host<-->all <--><------>all <--><------>91.106.201.242/32<----->md5
host<-->all <--><------>all <--><------>::1/128><------><------>md5
######create user free for freeswitch and create db with tables for freeswitch
CREATE ROLE free WITH PASSWORD 'free_password' LOGIN;
CREATE DATABASE freeswitch WITH OWNER free;
GRANT ALL ON DATABASE freeswitch TO free;
\c freeswitch
create table cdr (
id serial primary key,
local_ip_v4 inet not null,
caller_id_name varchar,
caller_id_number varchar,
destination_number varchar not null,
context varchar not null,
start_stamp timestamp with time zone not null,
answer_stamp timestamp with time zone,
end_stamp timestamp with time zone not null,
duration int not null,
billsec int not null,
hangup_cause varchar not null,
uuid uuid not null,
bleg_uuid uuid,
accountcode varchar,
read_codec varchar,
write_codec varchar,
sip_hangup_disposition varchar,
ani varchar
);
GRANT all privileges on table cdr to free;
ALTER TABLE cdr OWNER TO free; //after this cleared " mod_cdr_pg_csv.c:274 INSERT command failed: ERROR: permission denied for sequence cdr_id_seq"
//ALTER cdr_id_seq
//show tables
\dt
######
http://zhutov.ru/post/28/
cd /usr/src/freeswitch
in /usr/src/freeswitch/modules.conf
uncomment mod_cdr_pg_csv
./configure --enable-core-pgsql-support
make
make install
in /usr/local/freeswitch/conf/autoload
add
<load module="mod_cdr_pg_csv"/>
in /usr/local/freeswitch/conf/autoload_configs/cdr_pg_csv.conf
<param name="db-info" value="host=localhost dbname=freeswitch user=free password=free_password connect_timeout=10" />
<param name="legs" value="ab"/>
сами себе противоречат. заявляют о модульности архитектуры. заявляют о нативной поддержке postgresql.
Однако взаимодействие происходит через perl.
для использования необходимо перекомпилить core freeswitch.