<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";
        color:black;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.EmailStyle20
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";
        color:black;}
span.EmailStyle23
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor="white" lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Thx Daniel!<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">I will get the code from git. What do I need to recompile? Only unixodbc module? Any other lib? We are using installation done with the official rpm and would
 like to keep an environment as clean as possible and just change the modified libs.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Thx for this quick support.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Regards<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Giovanni<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext"> Daniel-Constantin Mierla [mailto:miconda@gmail.com]
<br>
<b>Sent:</b> lundi 2 mai 2016 10:49<br>
<b>To:</b> Mele Giovanni; Kamailio (SER) - Users Mailing List<br>
<b>Subject:</b> Re: [SR-Users] Kamailio and Oracle database<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p>Hello,<o:p></o:p></p>
<p>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.<o:p></o:p></p>
<p>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.<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">Cheers,<br>
Daniel<o:p></o:p></p>
<div>
<p class="MsoNormal">On 02/05/16 09:59, Mele Giovanni wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Hello,</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">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.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Regards</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Giovanni</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span><o:p></o:p></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext"> sr-users [<a href="mailto:sr-users-bounces@lists.sip-router.org">mailto:sr-users-bounces@lists.sip-router.org</a>]
<b>On Behalf Of </b>Daniel-Constantin Mierla<br>
<b>Sent:</b> lundi 2 mai 2016 09:49<br>
<b>To:</b> Kamailio (SER) - Users Mailing List<br>
<b>Subject:</b> Re: [SR-Users] Kamailio and Oracle database</span><o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"> <o:p></o:p></p>
<p>Hello,<o:p></o:p></p>
<p>are there two single quote characters or one double quotes character? Can you test if it works with double quotes instead of single quotes?<o:p></o:p></p>
<p>Cheers,<br>
Daniel<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<div>
<p class="MsoNormal">On 02/05/16 09:42, gmele wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>Hello Daniel,<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre>thx for your quick answer.<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre>After having failed with db_oracle module, we effectively tried db_unixodbc.<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre>But even with unixodbc, we got some strange errors when kamailio tries to do<o:p></o:p></pre>
<pre>queries including dates in the where clause:<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre>Example of an error reported by kamailio:<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre>May  2 08:30:14 newvm1 /usr/sbin/kamailio[26298]: ERROR: nathelper<o:p></o:p></pre>
<pre>[nathelper.c:2089]: nh_timer(): failed to fetch contacts<o:p></o:p></pre>
<pre>May  2 08:30:15 newvm1 /usr/sbin/kamailio[26298]: ERROR: db_unixodbc<o:p></o:p></pre>
<pre>[dbase.c:133]: db_unixodbc_submit_query(): rv=-1. Query= select<o:p></o:p></pre>
<pre>received,contact,socket,cflags,path,ruid from location *where<o:p></o:p></pre>
<pre>expires>''2016-05-02 06:30:15'' *AND partition=11 AND keepalive=1<o:p></o:p></pre>
<pre>May  2 08:30:15 newvm1 /usr/sbin/kamailio[26298]: ERROR: db_unixodbc<o:p></o:p></pre>
<pre>[connection.c:220]: db_unixodbc_extract_error():<o:p></o:p></pre>
<pre>unixodbc:SQLExecDirect=HY000:1:933:[Oracle][ODBC][Ora]ORA-00933: SQL command<o:p></o:p></pre>
<pre>not properly ended#012<o:p></o:p></pre>
<pre>May  2 08:30:15 newvm1 /usr/sbin/kamailio[26298]: ERROR: <core><o:p></o:p></pre>
<pre>[db_query.c:132]: db_do_query_internal(): error while submitting query<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre>As you can see, the date in the request seems has a double quote surrounding<o:p></o:p></pre>
<pre>it : where expires>''2016-05-02 06:30:15''. In fact it is 2 times the<o:p></o:p></pre>
<pre>character <'>.<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre>If I execute the above request in the isql tool provided by unixODBC, it<o:p></o:p></pre>
<pre>also fails. If I remove the double quote around the date, it works:<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre>select received,contact,socket,cflags,path,ruid from location *where<o:p></o:p></pre>
<pre>expires>'2016-05-02 06:30:15' *AND partition=11 AND keepalive=1;<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre>Do you have an idea on how to correct this problem? <o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre>Thx<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre>Regards<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre>Giovanni<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre>--<o:p></o:p></pre>
<pre>View this message in context: <a href="http://sip-router.1086192.n5.nabble.com/Kamailio-and-Oracle-database-tp147990p148005.html">http://sip-router.1086192.n5.nabble.com/Kamailio-and-Oracle-database-tp147990p148005.html</a><o:p></o:p></pre>
<pre>Sent from the Users mailing list archive at Nabble.com.<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<o:p></o:p></pre>
<pre><a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><o:p></o:p></pre>
<pre><a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><o:p></o:p></pre>
</blockquote>
<p class="MsoNormal"><br>
<br>
<br>
<o:p></o:p></p>
<pre>-- <o:p></o:p></pre>
<pre>Daniel-Constantin Mierla<o:p></o:p></pre>
<pre><a href="http://www.asipto.com">http://www.asipto.com</a><o:p></o:p></pre>
<pre><a href="http://twitter.com/#%21/miconda">http://twitter.com/#!/miconda</a> - <a href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a><o:p></o:p></pre>
<pre>Kamailio World Conference, Berlin, May 18-20, 2016 - <a href="http://www.kamailioworld.com">http://www.kamailioworld.com</a><o:p></o:p></pre>
</blockquote>
<p class="MsoNormal"><br>
<br>
<o:p></o:p></p>
<pre>-- <o:p></o:p></pre>
<pre>Daniel-Constantin Mierla<o:p></o:p></pre>
<pre><a href="http://www.asipto.com">http://www.asipto.com</a><o:p></o:p></pre>
<pre><a href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a><o:p></o:p></pre>
<pre>Kamailio World Conference, Berlin, May 18-20, 2016 - <a href="http://www.kamailioworld.com">http://www.kamailioworld.com</a><o:p></o:p></pre>
</div>
</body>
</html>