Hello,
hopefully I found and fixed the issue. The usrloc was setting the value
for time already quoted and then the db api was quoting again. I guess
you were using db-only mode for usrloc.
Can you try again with latest git branch 4.4 or master? Report back the
results in order to know if the issue was fixed or not.
Cheers,
Daniel
On 02/05/16 09:59, Mele Giovanni wrote:
Hello,
It is two single quote characters (‘). If I try with one double quote
character (“), it also fails. The only way to make it work is to have
one single quote character surrounding the date.
Regards
Giovanni
*From:*sr-users [mailto:sr-users-bounces@lists.sip-router.org] *On
Behalf Of *Daniel-Constantin Mierla
*Sent:* lundi 2 mai 2016 09:49
*To:* Kamailio (SER) - Users Mailing List
*Subject:* Re: [SR-Users] Kamailio and Oracle database
Hello,
are there two single quote characters or one double quotes character?
Can you test if it works with double quotes instead of single quotes?
Cheers,
Daniel
On 02/05/16 09:42, gmele wrote:
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-tp1479…
Sent from the Users mailing list archive at
Nabble.com.
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users(a)lists.sip-router.org <mailto:sr-users@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