Environment : CentOS Linux release 7.7
FS version : FreeSWITCH Version 1.10.3
Install unixODBC
yum install -y unixODBC unixODBC-devel mysql-connector-odbc
ODBC configuration
data source
Edit /etc/odbc.ini
PASSWORD - password used here is null, you may need to set the appropriate password according to their own
[freeswitch]
Driver = MySQL
SERVER = localhost
PORT = 3306
DATABASE = freeswitch
OPTION = 67108864
USER = root
PASSWORD =
Database-driven
Edit /etc/odbcinst.ini
[MySQL]
Description=ODBC for MySQL
Driver=/usr/lib/libmyodbc5.so
Setup=/usr/lib/libodbcmyS.so
#Driver64=/usr/lib64/libmyodbc5.so
Driver64=/usr/lib64/libmyodbc8a.so
Setup64=/usr/lib64/libodbcmyS.so
FileUsage=1
Test Data Source
isql -v freeswitch
The following appears, on behalf of success:
Alternative local sqlite with mysql
Compile-time, configure additional parameters enable-core-odbc-support
./configure --enable-core-odbc-support
After installation, Review sip_profiles configuration:
To sip_profiles / internal.xml example:
Find the line, the parameter is set to its own instance
<param name="odbc-dsn" value="freeswitch:root:"/>
Using ODBC write CDR
Compile mod_odbc_cdr
Compile time, the default does not compile mod_odbc_cdr
Open modules.conf
Find event_handlers / mod_odbc_cdr line, remove the comment, and then recompile installation
Configuration mod_odbc_cdr
Edit autoload_configs / modules.conf.xm, add a line, as follows:
<load module="mod_odbc_cdr"/>
verification
Connect to the database
isql -v freeswitch
Select Database
use freeswitch;
Display tables available
show tables;
test
So far, it has successfully completed the configuration, you can later view and configure the server through the database.
Precautions
ODBC Error. Data Source Name Not Found and No Default Driver Specified
If you encounter this error, there may be different results in the following parameters:
In this file /etc/odbc.ini inside, we set up a database name, and database user name and password
[freeswitch]
Driver = MySQL
SERVER = localhost
PORT = 3306
DATABASE = freeswitch
OPTION = 67108864
USER = root
PASSWORD =
We are in this sip_profiles / internal.xml file inside, modify the following
<param name="odbc-dsn" value="dsn:user:pass"/>
Note that the value to be filled out are the database name: Username: Password
We want to ensure that at 2 configuration is the same