[SR-Users] Kamailio and Oracle database

gmele giovanni.mele at nagra.com
Mon May 2 09:42:36 CEST 2016


Hello Daniel,

thx for your quick answer.

After having failed with db_oracle module, we effectively tried db_unixodbc.

But even with unixodbc, we got some strange errors when kamailio tries to do
queries including dates in the where clause:

Example of an error reported by kamailio:

May  2 08:30:14 newvm1 /usr/sbin/kamailio[26298]: ERROR: nathelper
[nathelper.c:2089]: nh_timer(): failed to fetch contacts
May  2 08:30:15 newvm1 /usr/sbin/kamailio[26298]: ERROR: db_unixodbc
[dbase.c:133]: db_unixodbc_submit_query(): rv=-1. Query= select
received,contact,socket,cflags,path,ruid from location *where
expires>''2016-05-02 06:30:15'' *AND partition=11 AND keepalive=1
May  2 08:30:15 newvm1 /usr/sbin/kamailio[26298]: ERROR: db_unixodbc
[connection.c:220]: db_unixodbc_extract_error():
unixodbc:SQLExecDirect=HY000:1:933:[Oracle][ODBC][Ora]ORA-00933: SQL command
not properly ended#012
May  2 08:30:15 newvm1 /usr/sbin/kamailio[26298]: ERROR: <core>
[db_query.c:132]: db_do_query_internal(): error while submitting query


As you can see, the date in the request seems has a double quote surrounding
it : where expires>''2016-05-02 06:30:15''. In fact it is 2 times the
character <'>.

If I execute the above request in the isql tool provided by unixODBC, it
also fails. If I remove the double quote around the date, it works:

select received,contact,socket,cflags,path,ruid from location *where
expires>'2016-05-02 06:30:15' *AND partition=11 AND keepalive=1;

Do you have an idea on how to correct this problem? 

Thx

Regards

Giovanni



--
View this message in context: http://sip-router.1086192.n5.nabble.com/Kamailio-and-Oracle-database-tp147990p148005.html
Sent from the Users mailing list archive at Nabble.com.



More information about the sr-users mailing list