1. Install unixodbc and MySQL ODBC Connector
Yum install unixodbc-devel mysql-connector-ODBC
2. Create a soft connection
Ln-s libmydbc5.so libmyodbc. So
3. Create the Database "freeswitch" on the remote MySQL server and create a password user.
4. Add the following DSN
/Etc/ODBC. ini and/root/. ODBC. ini
[Freeswitch]
Driver = MySQL
Server = 192.168.0.104
Port = 3306
Database = freeswitch
User = FSU
Password = 123456
Option = 3
5.Run the following command to test the connection:
isql freeswitch -v
Error:
[S1000][unixODBC][MySQL][ODBC 5.1 Driver]Host '192.168.0.105' is not allowed to connect to this MySQL server
[ISQL]ERROR: Could not SQLConnect
6.To remote MySQL
Under the server, go to the MySQL database and execute the following SQL command
Update user set host = '%' where user = 'root ';
Run the following command:
ISQL freeswitch username and password-V
Return
+ --------------------------------------- +
| Connected! |
|
| SQL-statement |
| Help [tablename] |
| Quit |
|
+ --------------------------------------- +
7. download the latest freeswitch: http://files.freeswitch.org/
8. decompress, configure, and compile freeswitch.
Tar-XF freeswitch-1.2.5.3.tar.bz2
./Configure -- enable-core-ODBC-support
Make & make install
9. Run the following command under/usr/local/freeswitch:
Grep-ir dsn.
Find all configuration files for which you want to use MySQL to replace SQLite.
Shown below
...
./Autoload_configs/switch. conf. xml: <Param name = "Core-db-DSN" value = "freeswitch: FSU: 123456"/>
./Autoload_configs/DB. conf. xml. Bak: <! -- <Param name = "ODBC-DSN" value = "DSN: User: Pass"/> -->
./Autoload_configs/cidlookup. conf. xml: <Param name = "ODBC-DSN" value = "Phone: Phone"/>
./Autoload_configs/voicemail. conf. xml: <! -- <Param name = "ODBC-DSN" value = "DSN: User: Pass"/> -->
./Autoload_configs/callcenter. conf. xml: <! -- <Param name = "ODBC-DSN" value = "DSN: User: Pass"/> -->
./Autoload_configs/nibblebill. conf. xml: <Param name = "db_dsn" value = "bandwidth.com"/>
./Autoload_configs/DB. conf. xml: <Param name = "ODBC-DSN" value = "freeswitch: FSU: 123456"/>
...
You can use MySQL to modify the parameter values in these configuration files.
For example
<Param name = "Core-db-DSN" value = "DSN: User: Pass"/>
Or
<Param name = "ODBC-DSN" value = "Phone: Phone"/>
10. Run freeswitch
The table is automatically created in the created freeswitch database during startup.
Reminder: before modifying important files in Linux, back up the files, such as cp xxx. conf XXX. conf. Bak.
Reference:
Using ODBC in the core
Http://wiki.freeswitch.org/wiki/Using_ODBC_in_the_core