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).
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:
The generic DSN format is
Note the 3rd / to indicate a local absolute path.
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
DSN with username
Note the colon at the end.
Note the two colons at the end.
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 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:
Add or uncomment the following line in appropriate config file within <settings></settings>
For call recovery, if track-calls is on. This is stored in a table called "recovery".
Adding your odbc-dsn param setting under global_settings will NOT work. It has to be put within <settings></settings> in each sip profile.
You will have to create the database table as described in MOD_Nibblebill