In Linux, freeswitch uses MySQL instead of SQLite for remote connection.

Source: Internet
Author: User
Tags freeswitch

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.