FreeSWITCH及VOIP,Openser,电话机器人等产品中文技术资讯、交流、沟通、培训、咨询、服务一体化网络。QQ群:293697898
来自于: https://wiki.freeswitch.org/wiki/Using_ODBC_in_the_core
sudo apt-get install unixodbc-dev libmyodbc
/etc/odbc.ini for MySQL
[freeswitch]
Driver = /usr/lib64/odbc/libmyodbc.so
SERVER = localhost
PORT = 3306
DATABASE = freeswitch
OPTION = 67108864
USER = root
PASSWORD = password
/etc/odbcinst.ini for MySQL
[MySQL]
Description = MySQL driver
Driver = /usr/lib64/odbc/libmyodbc.so
Setup = /usr/lib64/odbc/libodbcmyS.so
UsageCount = 1
FileUsage = 1
Threading = 0
isql -v freeswitch
如果正常会显示以下:
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+
SQL>
配置到FreeSWITCH中的DSN格式
DSN with username and password or
配置相关的配置文件,如:
1.修改conf/autoload_configs中的db.conf.xml文件
<param name="odbc-dsn" value="MYSQLTP:root:123456"/>
修改字段
<param name="core-db-dsn" value="MYSQLTP:root:123456" />
添加
<param name="odbc-dsn" value="MYSQLTP:root:123456"/>
3.修改conf/autoload_configs中的voicemail.conf.xml
修改字段
<param name="odbc-dsn" value="MYSQLTP:root:123456"/>
4.修改conf/autoload_configs中的callcenter.conf.xml
<param name="odbc-dsn" value="MYSQLTP:root:123456"/>
5.修改conf/sip_profiles中的internal.xml 和external.xml,internal-ipv6.xml
<param name="odbc-dsn" value="MYSQLTP:root:123456"/>