freeswitch 配置mysql数据库(基于mac)
1、安装unixodbc
brew install unixodbc
安装目录为/usr/local/Cellar/unixodbc/2.3.7
安装完成会在/usr/local/etc目录下生成odbc.ini和odbcinst.ini文件
2、下载安装mysql odbc connector
安装目录 /usr/local/mysql-connector-odbc-5.3.12-macos10.14-x86-64bit
cd /usr/local/mysql-connector-odbc-5.3.12-macos10.14-x86-64bit/bin
执行命令
./myodbc-installer -d -a -n "MySQL ODBC 5.3 ANSI Driver" -t "DRIVER=/usr/local/mysql-connector-odbc-5.3.12-macos10.14-x86-64bit/lib/libmyodbc5a.so”
myodbc-installer -a -s -n "freeswitch" -t "DRIVER=MySQL ODBC 5.3 ANSI Driver;SERVER=localhost;USER=free;PASSWORD=123456;OPTION=67108864”
会生成/Library/ODBC/下的两个文件
cp /Library/ODBC/odbc.ini ~/Library/ODBC
cp /Library/ODBC/odbcinst.ini ~/Library/ODBC
cp /Library/ODBC/odbc.ini /usr/local/etc/
cp /Library/ODBC/odbcinst.ini/usr/local/etc/
3、验证odbc 安装成功
isql -v freeswitch
4、freeswitch 支持odbc
cd /usr/local/src/freeswitch/src
sudo ./configure —enable-core-odbc-support=true
sudo make && make install
core数据库支持mysql odbc
修改 conf/autoload_configs/switch.conf.xml
<param name="core-db-dsn" value="freeswitch::"/>
<param name="odbc-dsn" value="freeswitch::"/>
<param name="auto-clear-sql" value="false”/>
sip支持mysql odbc
修改conf/sip_profiles/internal.xml
<param name="odbc-dsn" value="freeswitch::"/>
5、运行freeswitch
cd /usr/local/freeswitch/db/
rm *
运行:freeswitch -c nonat