ubuntu16.04.3配置freeswitch1.6使用PostgreSQL

安装 PostgreSQL

sudo apt-get -y install postgresql

创建存放表空间目录

sudo mkdir -p /usr/local/freeswitch/db/psdb
sudo chown postgres:postgres /usr/local/freeswitch/db/psdb

修改监听IP

sudo vim /etc/postgresql/9.5/main/postgresql.conf

做如下修改

listen_addresses = '*'

对所有网段全开放:

sudo vim /etc/postgresql/9.5/main/pg_hba.conf
#IPV4
host    all             all             0.0.0.0/0                 md5
#IPV6
host    all             all             ::/0                    md5

重启ps

sudo /etc/init.d/postgresql restart

修改PostgreSQL密码

sudo su - postgres
 postgres@ubuntu:~$ psql

postgres@ubuntu:~$ psql
psql (9.5.8)
Type "help" for help.

postgres=# \password
Enter new password: 
Enter it again: 

建数据库

创建角色
postgres=# create role freeswitch createdb createrole login   password '123456';

创建表空间
postgres=# create tablespace freeswitch_space owner freeswitch location '/usr/local/freeswitch/db/psdb';
CREATE TABLESPACE

切换角色并创建数据库
postgres=# set session authorization freeswitch;
SET
postgres=> create database freeswitch_core tablespace freeswitch_space ;
CREATE DATABASE
postgres=> create database sofia_reg_internal tablespace freeswitch_space ;
CREATE DATABASE
postgres=> create database sofia_reg_external tablespace freeswitch_space ;
CREATE DATABASE
postgres=> create database sofia_reg_internal6 tablespace freeswitch_space ;
CREATE DATABASE
postgres=> create database sofia_reg_external6 tablespace freeswitch_space ;
CREATE DATABASE

postgres=> create database call_limit tablespace freeswitch_space ;
CREATE DATABASE
postgres=> create database fifo tablespace freeswitch_space ;
CREATE DATABASE

建立新用户、角色
postgres=> create user freeswitch_core password '123456' createdb;
CREATE ROLE
postgres=> 

使用新用户登入freeswitch_core数据库
postgres=> \q
postgres@ubuntu:~$ psql -U freeswitch_core -h localhost -d freeswitch_core

修改fs配置后重启

sudo vim /usr/local/freeswitch/conf/autoload_configs/switch.conf.xml
<param name="core-db-dsn" value="pgsql://hostaddr='127.0.0.1' dbname='freeswitch_core' user='freeswitch_core' password='123456' options='-c client_min_messages=NOTICE' application_name='freeswitch'" />

 sudo vim /usr/local/freeswitch/conf/sip_profiles/internal.xml
 <param name="odbc-dsn" value="pgsql://hostaddr='127.0.0.1' dbname='sofia_reg_internal' user=freeswitch password='123456' options='-c client_min_messages=NOTICE' application_name='freeswitch'" />
 
sudo vim /usr/local/freeswitch/conf/sip_profiles/internal-ipv6.xml
 <param name="odbc-dsn" value="pgsql://hostaddr='127.0.0.1' dbname='sofia_reg_internal6' user=freeswitch password='123456' options='-c client_min_messages=NOTICE' application_name='freeswitch'" />
 
sudo vim /usr/local/freeswitch/conf/sip_profiles/external.xml
 <param name="odbc-dsn" value="pgsql://hostaddr='127.0.0.1' dbname='sofia_reg_external' user=freeswitch password='123456' options='-c client_min_messages=NOTICE' application_name='freeswitch'" />
 
sudo vim /usr/local/freeswitch/conf/sip_profiles/external-ipv6.xml
 <param name="odbc-dsn" value="pgsql://hostaddr='127.0.0.1' dbname='sofia_reg_external6' user=freeswitch password='123456' options='-c client_min_messages=NOTICE' application_name='freeswitch'" />
 
sudo vim /usr/local/freeswitch/conf/autoload_configs/db.conf.xml
<param name="odbc-dsn" value="pgsql://hostaddr='127.0.0.1' dbname='call_limit' user=freeswitch password='123456' options='-c client_min_messages=NOTICE' application_name='freeswitch'" />

sudo vim /usr/local/freeswitch/conf/autoload_configs/fifo.conf.xml
<settings>
<param name="odbc-dsn" value="pgsql://hostaddr='127.0.0.1' dbname='fifo' user=freeswitch password='123456' options='-c client_min_messages=NOTICE' application_name='freeswitch'" />
</settings>

您的支持,是我持续创作的动力!!!!
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值