UNIXODBC module
Admin Guide
Section titled “Admin Guide”Overview
Section titled “Overview”This module allows to use the unixodbc package with OpenSIPS. It have been tested with mysql and the odbc connector, but it should work also with other database. The auth_db module works.
For more information, see the http://www.unixodbc.org/ project web page.
To see what DB engines can be used via unixodbc, look at http://www.unixodbc.org/drivers.html.
Dependencies
Section titled “Dependencies”OpenSIPS Modules
Section titled “OpenSIPS Modules”The following modules must be loaded before this module:
- No dependencies on other OpenSIPS modules.
External Libraries or Applications
Section titled “External Libraries or Applications”The following libraries or applications must be installed before running OpenSIPS with this module loaded:
- None.
Exported Parameters
Section titled “Exported Parameters”auto_reconnect (int)
Section titled “auto_reconnect (int)”Turns on or off the auto_reconnect mode.
Default value is “1”, this means it is enabled.
...modparam("db_unixodbc", "auto_reconnect", 0)...use_escape_common (int)
Section titled “use_escape_common (int)”Escape values in query using internal escape_common() function. It escapes single quote ''', double quote ’”’, backslash ”, and NULL characters.
You should enable this parameter if you know that the ODBC driver considers the above characters as special (for marking begin and end of a value, escape other characters …). It prevents against SQL injection.
Default value is “0” (0 = disabled; 1 = enabled).
...modparam("db_unixodbc", "use_escape_common", 1)...Exported Functions
Section titled “Exported Functions”NONE
Installation and Running
Section titled “Installation and Running”Installing
Section titled “Installing”Prerequirement: you should first install unixodbc (or another program that implements the odbc standard, such iodbc), your database, and the right connector. Set the DSN in the odbc.ini file and the connector drivers in the odbcinst.ini file.
Configuring and Running
Section titled “Configuring and Running”In the opensips.conf file, add the line:
....loadmodule "/usr/local/lib/opensips/modules/db_unixodbc.so"....You should also uncomment this:
....loadmodule "/usr/local/lib/opensips/modules/auth.so"loadmodule "/usr/local/lib/opensips/modules/auth_db.so"modparam("usrloc", "db_mode", 2)modparam("auth_db", "calculate_ha1", yes)modparam("auth_db", "password_column", "password")....and setting the DSN specified in the odbc.ini, inserting this with the url adding this line:
....modparam("usrloc|auth_db", "db_url", "unixodbc://opensips:opensipsrw@localhost/my_dsn")....replacing my_dsn with the correct value.
shell>safe_mysqld --user=mysql --socket=/var/lib/mysql/mysql.sockThe connector search the socket in /var/lib/mysql/mysql.sock and not in /tmp/mysql.sock
Developer Guide
Section titled “Developer Guide”The module implements the OpenSIPS DB API, in order to be used by other modules.
Contributors
Section titled “Contributors”By Commit Statistics
Section titled “By Commit Statistics”Top contributors by DevScore(1), authored commits(2) and lines added/removed(3)
| # | Name | DevScore | Commits | Lines++ | Lines— |
|---|---|---|---|---|---|
| 1. | Henning Westerholt (@henningw) | 102 | 24 | 2618 | 3362 |
| 2. | Bogdan-Andrei Iancu (@bogdan-iancu) | 45 | 31 | 661 | 462 |
| 3. | Marco Lorrai | 24 | 1 | 2660 | 0 |
| 4. | Daniel-Constantin Mierla (@miconda) | 20 | 15 | 226 | 145 |
| 5. | Liviu Chircu (@liviuchircu) | 20 | 11 | 183 | 362 |
| 6. | Razvan Crainea (@razvancrainea) | 11 | 9 | 65 | 28 |
| 7. | Stefan Darius (@dariusstefan) | 7 | 4 | 197 | 25 |
| 8. | Vlad Patrascu (@rvlad-patrascu) | 4 | 2 | 3 | 3 |
| 9. | Anca Vamanu | 4 | 1 | 89 | 103 |
| 10. | Elena-Ramona Modroiu | 3 | 1 | 37 | 1 |
All remaining contributors: Anonymous, Konstantin Bokarius, Razvan Pistolea, Alex Massover, Norman Brandinger (@NormB), Peter Lemenkov (@lemenkov), Edson Gellert Schubert, Vlad Paiu (@vladpaiu), Carsten Bock.
(1) DevScore = author_commits + author_lines_added / (project_lines_added / project_commits) + author_lines_deleted / (project_lines_deleted / project_commits)
(2) including any documentation-related commits, excluding merge commits
(3) ignoring whitespace edits, renamed files and auto-generated files
By Commit Activity
Section titled “By Commit Activity”| # | Name | Commit Activity |
|---|---|---|
| 1. | Stefan Darius (@dariusstefan) | Jun 2026 - Jul 2026 |
| 2. | Razvan Crainea (@razvancrainea) | Oct 2011 - Jun 2026 |
| 3. | Liviu Chircu (@liviuchircu) | Mar 2014 - May 2024 |
| 4. | Bogdan-Andrei Iancu (@bogdan-iancu) | Dec 2005 - Apr 2019 |
| 5. | Vlad Patrascu (@rvlad-patrascu) | May 2017 - Apr 2019 |
| 6. | Peter Lemenkov (@lemenkov) | Jun 2018 - Jun 2018 |
| 7. | Vlad Paiu (@vladpaiu) | Jul 2011 - Jul 2011 |
| 8. | Razvan Pistolea | Jul 2009 - Jul 2009 |
| 9. | Alex Massover | Mar 2009 - Mar 2009 |
| 10. | Carsten Bock | May 2008 - May 2008 |
All remaining contributors: Henning Westerholt (@henningw), Daniel-Constantin Mierla (@miconda), Konstantin Bokarius, Edson Gellert Schubert, Anca Vamanu, Elena-Ramona Modroiu, Norman Brandinger (@NormB), Anonymous, Marco Lorrai.
(1) including any documentation-related commits, excluding merge commits
Documentation
Section titled “Documentation”Contributors
Section titled “Contributors”Last edited by: Razvan Crainea (@razvancrainea), Peter Lemenkov (@lemenkov), Liviu Chircu (@liviuchircu), Bogdan-Andrei Iancu (@bogdan-iancu), Daniel-Constantin Mierla (@miconda), Konstantin Bokarius, Edson Gellert Schubert, Henning Westerholt (@henningw), Elena-Ramona Modroiu, Marco Lorrai.
License
Section titled “License”All documentation files (i.e. .md extension) are licensed under the Creative Common License 4.0