Call Us Today! 877.742.2583




Page tree
Skip to end of metadata
Go to start of metadata

About

The default FreeSWITCH configuration uses a series of SQLite databases that are stored the /usr/local/freeswitch/db directory of a FreeSWITCH installation. This configuration can be changed to connect to other databases like PostgreSQL (native) or MySQL (via ODBC).

 Click here to expand Table of Contents


DSN connection strings

The FreeSWITCH core provides the API for modules to make connections to databases. These database connections are defined with data source names (DSN) in XML configuration params like "core-db-dsn", "odbc-dsn", etc.

FreeSWITCH currently supports the following DSN types:

DSN Format

The generic DSN format is


SQLite DSNs


Note the 3rd / to indicate a local absolute path.

PostgreSQL DSNs


ODBC DSNs

Now (2012-11) that FreeSWITCH supports multiple core database options (PostgreSQL, ODBC, SQLite), the format for the DSN has changed so that FreeSWITCH knows which database type to use.

The following DSN (data source name) formats are valid for ODBC databases:

DSN with username and password

 

or

 

DSN with username

Note the colon at the end.

or

 

DSN only

Note the two colons at the end.

or

 

 

The following formats NO LONGER WORK (since v1.2.4)

<param name="core-db-dsn" value="database"/>
<param name="core-db-dsn" value="database:password"/> 

 

DSN-less

DSN-less connections are also possible. Such connections don't require setting up in odbc.ini.

Essentially the syntax is the same options you would have in odbc.ini name-value pairs, separated by ;

MyODBC example (OPTION=67108864 enables batched statements):

 

Modules that use databases

Instead of using the default SQLite database as the internal FreeSWITCH database, you can use any core database type. This works for.

 

Configuring FreeSWITCH to use databases

For the core:

conf/autoload_configs/switch.conf.xml

Add or uncomment the following line in appropriate config file within <settings></settings>

 

recovery

For call recovery, if track-calls is on. This is stored in a table called "recovery".

In switch.conf.xml:

 

mod_sofia

Adding your odbc-dsn param setting under global_settings will NOT work. It has to be put within <settings></settings> in each sip profile.

 

mod_limit

  • db.conf.xml

mod_voicemail

  • voicemail.conf.xml

mod_lcr

  • lcr.conf.xml

mod_nibblebill

  • nibblebill.conf.xml

You will have to create the database table as described in MOD_Nibblebill