[SR-Users] unixODBC failure/bug?

Nagorny, Dimitry dimitry.nagorny at robot5.de
Mon May 2 10:35:57 CEST 2016


Von: sr-users [mailto:sr-users-bounces at lists.sip-router.org] Im Auftrag von Nagorny, Dimitry
Gesendet: Montag, 2. Mai 2016 10:15
An: Kamailio (SER) - Users Mailing List <sr-users at lists.sip-router.org>
Betreff: Re: [SR-Users] unixODBC failure/bug?

Hi Daniel,

I didn't have an example I just tried around with the unixODBC-module URL until it worked.
The current state is as follows:

odbcinst.ini:
[MARIADB]
Description=MariaDB ODBC
Driver=/usr/lib64/libmyodbc5w.so
Setup=/usr/lib64/libmyodbc5S.so
Trace=no
Server=10.250.5.16
Port=3306
UID=<username>
PWD=<password>
Database=kamailio
UsageCount=2

odbc.ini:
[MARIADB]
Description=MariaDB ODBC
Driver=/usr/lib64/libmyodbc5w.so
Setup=/usr/lib64/libmyodbc5S.so
Trace=no
Server=10.250.5.16
Port=3306
UID=<username>
PWD=<password>
Database=kamailio

If you have configured unixodbc with username, password and database like me, the unixodbc-URL is this:
Corrected Typo here (Three Slashes not two):
#!define DBURL "unixodbc:///MARIADB"

MARIADB pointing here to the name in the brackets [] in odbc.ini.

If you configure the odbc.ini-scripts without username and password but with database-name it was working for me like this:
#!define DBURL "unixodbc://<username>:<password>@<DB-IP>/MARIADB"

I couldn't get it working without the database-name in the odbc.ini-scripts.


Best Regards
Dimitry Nagorny
Trainee

Von: sr-users [mailto:sr-users-bounces at lists.sip-router.org] Im Auftrag von Daniel-Constantin Mierla
Gesendet: Montag, 2. Mai 2016 09:33
An: Kamailio (SER) - Users Mailing List <sr-users at lists.sip-router.org<mailto:sr-users at lists.sip-router.org>>
Betreff: Re: [SR-Users] unixODBC failure/bug?


OK, great it was sorted out.

Btw, did you see any example using unixODBC for kamalio modules URLs? If yes, let us know, we need to correct that.
Cheers,
Daniel
On 29/04/16 12:54, Nagorny, Dimitry wrote:
Thanks a lot Daniel, that was the culprit.


Best Regards
Dimitry Nagorny
Trainee

Von: sr-users [mailto:sr-users-bounces at lists.sip-router.org] Im Auftrag von Daniel-Constantin Mierla
Gesendet: Freitag, 29. April 2016 12:30
An: Kamailio (SER) - Users Mailing List <sr-users at lists.sip-router.org><mailto:sr-users at lists.sip-router.org>
Betreff: Re: [SR-Users] unixODBC failure/bug?


Hello,

can try with ODBC written with lowercase letters in DBURL? File names should be case sensitive on Linux OS.

Cheers,
Daniel

On 29/04/16 11:45, Nagorny, Dimitry wrote:
Hi all,

I am trying to use the unixODBC module to connect to MariaDB as a first step and then to test it to connect to MSSQL (please don't blame me on MSSQL...). I am using Kamailio 4.3.5 on CentOS7.2 fully patched. Here info about installed unixODBC:

[root at r5dev-KAM1 ~]# yum list installed | grep unix
unixODBC.x86_64                       2.3.1-11.el7                    @base
unixODBC-devel.x86_64            2.3.1-11.el7                    @base

Which leads me to my possible problem that I can't start Kamailio with db_unixodbc.so because it is giving me this error:

r5dev-KAM1 /usr/local/kamailio/sbin/kamailio[16307]: ERROR: <core> [db.c:203]: db_bind_mod(): Module db_unixODBC not found. Missing loadmodule?

Followed by errors from modules depending on the DBURL are failing as well. Here my modules part:

...
#!define DBURL "unixODBC://root:<passw>@localhost/MARIADB"
...
# Module Path
mpath="/usr/local/kamailio/lib64/kamailio/modules/"

loadmodule "tls.so"
# ----- tls params -----
modparam("tls", "config", "/usr/local/kamailio/etc/kamailio/tls.cfg")

#loadmodule "db_mysql.so"
loadmodule "db_unixodbc.so"
...

I doublechecked that the module was compiled and is present:

[root at r5dev-KAM1 ~]# ls -ll /usr/local/kamailio/lib64/kamailio/modules/ | grep unix
-rwxr-xr-x. 1 root root  184451 28. Apr 08:56 db_unixodbc.so

I tried to check the db.c and db_unixodbc.c but I am not familiar with the c-syntax.
I somehow suspect that the error is related to Linux case sensitivity if db.c is trying to check if "unixODBC" is installed and then trying to match it with the "db_unixodbc.so" but I'm am not sure.

Can someone please give further advice?


Respectfully
Dimitry Nagorny
Trainee




_______________________________________________

SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list

sr-users at lists.sip-router.org<mailto:sr-users at lists.sip-router.org>

http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users



--

Daniel-Constantin Mierla

http://www.asipto.com

http://twitter.com/#!/miconda<http://twitter.com/#%21/miconda> - http://www.linkedin.com/in/miconda

Kamailio World Conference, Berlin, May 18-20, 2016 - http://www.kamailioworld.com



_______________________________________________

SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list

sr-users at lists.sip-router.org<mailto:sr-users at lists.sip-router.org>

http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


--

Daniel-Constantin Mierla

http://www.asipto.com

http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda

Kamailio World Conference, Berlin, May 18-20, 2016 - http://www.kamailioworld.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20160502/fd9bc068/attachment.html>


More information about the sr-users mailing list