Call Us Today! 877.742.2583

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


mod_db implements an API and dialplan interface to a database backend. The database can either be in sqlite or ODBC. It also provides support for group dialing and provides database backed limit interface.

 Click here to expand Table of Contents


ODBC must be configured to use ODBC resources (configure with --enable-core-odbc-support).


mod_db is compiled and loaded by default. Modify db.conf to enable ODBC.


Realm and key are arbitrary strings. Consider realm as a container for keys.

Dialplan Application


Insert a value into the database:

mod_db manages 'realm/key' as a UNIQUE tuple (2-tuple). So if you 'insert' two, or more, times the same 'realm/key' tuple, then only one row, of 'realm/key/value', will be in the persistent database. The one-only stored row is the row resulting from the last successful 'insert/realm/key/value' method (last-in). Method 'select/realm/key' returns this last-in, one-only resulting row.

As of 2013-05-08, newly created schemas enforce this uniqueness with an index. Previous versions only maintain it internally with a SQL delete + insert.

Delete an entry from the database:

Retrieve a value from the database:

Use as a condition:

Use as a condition checking if item exists:


Group allows one to define multiple endpoints for a given destination (group).

Insert a group entry:

Delete a group entry:

Select a group entry:





The db backend for limit provides a persistent datastore for limit data. If using ODBC, this backend can also be shared across a cluster of  FreeSWITCH™ instances.

This backend does NOT support rate based limits.