将 Kamailio 与 PostgreSQL 连接起来
Connect Kamailio with PostgreSQL
我有一个特定的情况需要将 Kamailio 连接到 PostgreSQL 数据库而不是 MySQL。有人可以为此提供步骤吗?尝试了论坛中的多个步骤,但都失败了。
面临的问题:每当 kamailio 在 PostgreSQL 中创建数据库时,它都会不断询问密码并最终失败。
Ubuntu 版本:16.04 LTS
卡麦里奥:5.0
到目前为止我做了以下事情:
1.包括postgre模块
2.修改kamailio.cfg并添加以下行:
#!ifdef WITH_PGSQL
# - database URL - used to connect to database server by modules such
# as: auth_db, acc, usrloc, a.s.o.
#!ifndef DBURL
#!define DBURL "postgres://kamailio:password@localhost/kamailio"
#!endif
#!endif
这是我的文件 kambdctlrc:
# The Kamailio configuration file for the control tools.
#
# Here you can set variables used in the kamctl and kamdbctl setup
# scripts. Per default all variables here are commented out, the control tools
# will use their internal default values.
## your SIP domain
SIP_DOMAIN=sip.<DOMAIN>.net
## chrooted directory
# $CHROOT_DIR="/path/to/chrooted/directory"
## database type: MYSQL, PGSQL, ORACLE, DB_BERKELEY, DBTEXT, or SQLITE
# by default none is loaded
#
# If you want to setup a database with kamdbctl, you must at least specify
# this parameter.
DBENGINE=PGSQL
## database host
DBHOST=localhost
## database host
# DBPORT=3306
## database name (for ORACLE this is TNS name)
DBNAME=kamailio
# database path used by dbtext, db_berkeley or sqlite
# DB_PATH="/usr/local/etc/kamailio/dbtext"
## database read/write user
DBRWUSER="kamailio"
## password for database read/write user
DBRWPW="password"
## database read only user
DBROUSER="kamailioro"
提前致谢!!
终于,我们找到了问题所在,这是 .pgpass 文件中的一个小错误,最终导致了身份验证问题。
我有一个特定的情况需要将 Kamailio 连接到 PostgreSQL 数据库而不是 MySQL。有人可以为此提供步骤吗?尝试了论坛中的多个步骤,但都失败了。
面临的问题:每当 kamailio 在 PostgreSQL 中创建数据库时,它都会不断询问密码并最终失败。
Ubuntu 版本:16.04 LTS 卡麦里奥:5.0
到目前为止我做了以下事情: 1.包括postgre模块 2.修改kamailio.cfg并添加以下行:
#!ifdef WITH_PGSQL
# - database URL - used to connect to database server by modules such
# as: auth_db, acc, usrloc, a.s.o.
#!ifndef DBURL
#!define DBURL "postgres://kamailio:password@localhost/kamailio"
#!endif
#!endif
这是我的文件 kambdctlrc:
# The Kamailio configuration file for the control tools.
#
# Here you can set variables used in the kamctl and kamdbctl setup
# scripts. Per default all variables here are commented out, the control tools
# will use their internal default values.
## your SIP domain
SIP_DOMAIN=sip.<DOMAIN>.net
## chrooted directory
# $CHROOT_DIR="/path/to/chrooted/directory"
## database type: MYSQL, PGSQL, ORACLE, DB_BERKELEY, DBTEXT, or SQLITE
# by default none is loaded
#
# If you want to setup a database with kamdbctl, you must at least specify
# this parameter.
DBENGINE=PGSQL
## database host
DBHOST=localhost
## database host
# DBPORT=3306
## database name (for ORACLE this is TNS name)
DBNAME=kamailio
# database path used by dbtext, db_berkeley or sqlite
# DB_PATH="/usr/local/etc/kamailio/dbtext"
## database read/write user
DBRWUSER="kamailio"
## password for database read/write user
DBRWPW="password"
## database read only user
DBROUSER="kamailioro"
提前致谢!!
终于,我们找到了问题所在,这是 .pgpass 文件中的一个小错误,最终导致了身份验证问题。