Skip to main content

ODBC DSN

About

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:

Click here to expand Table of Contents

DSN with username and password

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

or

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

DSN with username

Note the colon at the end.

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

or

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

DSN only

Note the two colons at the end.

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

or

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

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):

<param name="core-db-dsn" value="odbc://DRIVER=mysql;SERVER=a.b.c.d;UID=username;PWD=secretpassword;DATABASE=freeswitch;OPTION=67108864">