<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Hi,<br>
    <br>
    From the source code, mod_nibblebill.c (git 726e522434), you can
    still use both: "odbc-dsn" or "db_dsn", but the last one is
    deprecated, so the correct to use is "odbc-dsn".<br>
    <br>
    1) you can set variable "nibble_rounding" to adjust rounding
    precision.<br>
    <br>
    2) not an expert on this, but since all the queries can be custom
    you can adjust them to use variables from the dialplan to make it
    more dynamic..  <br>
    <br>
    <br>
    <br>
    <div class="moz-cite-prefix">On 01/04/2018 10:18 AM,
      <a class="moz-txt-link-abbreviated" href="mailto:igor.potjevlesch@gmail.com">igor.potjevlesch@gmail.com</a> wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:004901d3853d$08e21590$1aa640b0$@gmail.com">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 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:11.0pt;
        font-family:"Calibri",sans-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;}
pre
        {mso-style-priority:99;
        mso-style-link:"Préformaté HTML Car";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;}
p.inbox-inbox-p1, li.inbox-inbox-p1, div.inbox-inbox-p1
        {mso-style-name:inbox-inbox-p1;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;}
span.inbox-inbox-s1
        {mso-style-name:inbox-inbox-s1;}
span.inbox-inbox-apple-converted-space
        {mso-style-name:inbox-inbox-apple-converted-space;}
span.PrformatHTMLCar
        {mso-style-name:"Préformaté HTML Car";
        mso-style-priority:99;
        mso-style-link:"Préformaté HTML";
        font-family:Consolas;
        color:black;}
span.EmailStyle24
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.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;}
/* List Definitions */
@list l0
        {mso-list-id:244918271;
        mso-list-type:hybrid;
        mso-list-template-ids:1201440206 67895311 67895321 67895323 67895311 67895321 67895323 67895311 67895321 67895323;}
@list l0:level1
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></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]-->
      <div class="WordSection1">
        <p class="MsoNormal"><span
            style="color:windowtext;mso-fareast-language:EN-US">Hello,<o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="color:windowtext;mso-fareast-language:EN-US"
            lang="EN-GB"><br>
            Thank you!<o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="color:windowtext;mso-fareast-language:EN-US"
            lang="EN-GB">Both db_dsn and odbc-dsn work. db-dsn fails.<o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="color:windowtext;mso-fareast-language:EN-US"
            lang="EN-GB">I keep the version with odbc-dsn because in
            that case I don't have the warning about deprecated function
            for versions earlier than 1.4.2 even if I run 1.6.<o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="color:windowtext;mso-fareast-language:EN-US"
            lang="EN-GB"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span
            style="color:windowtext;mso-fareast-language:EN-US"
            lang="EN-GB">What is the best according to you? db_dsn or
            odbc-dsn?<o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="color:windowtext;mso-fareast-language:EN-US"
            lang="EN-GB"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span
            style="color:windowtext;mso-fareast-language:EN-US"
            lang="EN-GB">I have additional questions related to nibble:<o:p></o:p></span></p>
        <ol style="margin-top:0cm" start="1" type="1">
          <li class="MsoListParagraph"
            style="color:windowtext;margin-left:0cm;mso-list:l0 level1
            lfo1"><span style="mso-fareast-language:EN-US" lang="EN-GB">After
              hanging up the call, I see in the logs the good value:
              "mod_nibblebill.c:590 Billing $0.000234" but some line
              after there is another update: "mod_nibblebill.c:622
              Rounding to precision 1.000000, total 1.000000 (0.999793
              excess)". So the call is billed 1 instead of 0.000234. <o:p></o:p></span></li>
          <li class="MsoListParagraph"
            style="color:windowtext;margin-left:0cm;mso-list:l0 level1
            lfo1"><span style="mso-fareast-language:EN-US" lang="EN-GB">Is
              it possible to setup in the db scheme different prefixes
              and their rate? Instead of putting them raw in the
              dialplan or any other config file?<o:p></o:p></span></li>
        </ol>
        <p class="MsoNormal"><span
            style="color:windowtext;mso-fareast-language:EN-US"
            lang="EN-GB"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span
            style="color:windowtext;mso-fareast-language:EN-US"
            lang="EN-GB">Thank you in advance for your clarification.<br>
            <br>
            Regards,<o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="color:windowtext;mso-fareast-language:EN-US"
            lang="EN-GB"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span
            style="color:windowtext;mso-fareast-language:EN-US"
            lang="EN-GB">Igor.<o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="color:windowtext;mso-fareast-language:EN-US"
            lang="EN-GB"><o:p> </o:p></span></p>
        <div>
          <div style="border:none;border-top:solid #E1E1E1
            1.0pt;padding:3.0pt 0cm 0cm 0cm">
            <p class="MsoNormal"><b><span style="color:windowtext">De :</span></b><span
                style="color:windowtext"> FreeSWITCH-users
                [<a class="moz-txt-link-freetext" href="mailto:freeswitch-users-bounces@lists.freeswitch.org">mailto:freeswitch-users-bounces@lists.freeswitch.org</a>] <b>De
                  la part de</b> Madovsky<br>
                <b>Envoyé :</b> mercredi 3 janvier 2018 22:18<br>
                <b>À :</b> <a class="moz-txt-link-abbreviated" href="mailto:freeswitch-users@lists.freeswitch.org">freeswitch-users@lists.freeswitch.org</a><br>
                <b>Objet :</b> Re: [Freeswitch-users] Use Nibblebill
                with PostgreSQL<o:p></o:p></span></p>
          </div>
        </div>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p>If you compiled FS with --enable-core-odbc-support so you can
          use<o:p></o:p></p>
        <p><param name="odbc-dsn" value="pgsql://hostaddr=xx.xx.xx.xx
          port=xxxx dbname=xxx user=xxx password='xxxx' options='-c
          client_min_messages=NOTICE' application_name='freeswitch'"
          /><o:p></o:p></p>
        <p>you must set odbc.ini<o:p></o:p></p>
        <div>
          <p class="MsoNormal">On 1/3/2018 1:02 PM, Geoff Mina wrote:<o:p></o:p></p>
        </div>
        <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
          <p class="MsoNormal">I think the param is db-dsn. Not the
            underscore version. <o:p></o:p></p>
          <div>
            <p class="MsoNormal" style="margin-bottom:12.0pt"><br>
              On Jan 3, 2018, at 12:59 PM, Sergey Safarov <<a
                href="mailto:s.safarov@gmail.com" moz-do-not-send="true">s.safarov@gmail.com</a>>
              wrote:<o:p></o:p></p>
          </div>
          <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
            <div>
              <div>
                <p class="MsoNormal">I used connection string<o:p></o:p></p>
                <p class="inbox-inbox-p1"><span
                    class="inbox-inbox-apple-converted-space"><span
                      style="color:blue"> </span></span><span
                    class="inbox-inbox-s1"><span style="color:blue"><param
                      name="db_dsn" value="pgsql://hostaddr=127.0.0.1
                      dbname=******* user=******* password=*******"/></span></span><o:p></o:p></p>
                <p class="inbox-inbox-p1"><span class="inbox-inbox-s1">Sergey</span><o:p></o:p></p>
              </div>
              <p class="MsoNormal"><o:p> </o:p></p>
              <div>
                <div>
                  <p class="MsoNormal">ср, 3 янв. 2018 г. в 22:06, <<a
                      href="mailto:igor.potjevlesch@gmail.com"
                      moz-do-not-send="true">igor.potjevlesch@gmail.com</a>>:<o:p></o:p></p>
                </div>
                <blockquote style="border:none;border-left:solid #CCCCCC
                  1.0pt;padding:0cm 0cm 0cm
                  6.0pt;margin-left:4.8pt;margin-right:0cm">
                  <div>
                    <div>
                      <p class="MsoNormal"
                        style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Hello
                        !<o:p></o:p></p>
                      <p class="MsoNormal"
                        style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
                      <p class="MsoNormal"
                        style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
                          lang="EN-GB">I try to connect Nibblebill
                          directly to PostgreSQL but it still fails.</span><o:p></o:p></p>
                      <p class="MsoNormal"
                        style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
                          lang="EN-GB">I follow the documentation and
                          setup the param like this: <param
                          name="odbc_dsn" value="pgsql://A.B.C.D
                          dbname=prepaid user=prepaid
                          password=<hidden>"/></span><o:p></o:p></p>
                      <p class="MsoNormal"
                        style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
                          lang="EN-GB"> </span><o:p></o:p></p>
                      <p class="MsoNormal"
                        style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
                          lang="EN-GB">When I hangup a call, the logs
                          report the following:
                          52c8b77c-f0b8-11e7-8d19-5566a3fb77f6
                          2018-01-03 20:00:19.037333 [CRIT]
                          mod_nibblebill.c:604 Failed to log to
                          database!</span><o:p></o:p></p>
                      <p class="MsoNormal"
                        style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
                          lang="EN-GB"> </span><o:p></o:p></p>
                      <p class="MsoNormal"
                        style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
                          lang="EN-GB">Any idea on how to proceed with
                          FS 1.6? Thank you!</span><o:p></o:p></p>
                      <p class="MsoNormal"
                        style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
                          lang="EN-GB"> </span><o:p></o:p></p>
                      <p class="MsoNormal"
                        style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
                          lang="EN-GB">Regards,</span><o:p></o:p></p>
                      <p class="MsoNormal"
                        style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
                          lang="EN-GB"> </span><o:p></o:p></p>
                      <p class="MsoNormal"
                        style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
                          lang="EN-GB">Igor.</span><o:p></o:p></p>
                      <p class="MsoNormal"
                        style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
                          lang="EN-GB"> </span><o:p></o:p></p>
                    </div>
                  </div>
                  <p class="MsoNormal">_________________________________________________________________________<br>
                    Professional FreeSWITCH Consulting Services:<br>
                    <a href="mailto:consulting@freeswitch.org"
                      target="_blank" moz-do-not-send="true">consulting@freeswitch.org</a><br>
                    <a href="http://www.freeswitchsolutions.com"
                      target="_blank" moz-do-not-send="true">http://www.freeswitchsolutions.com</a><br>
                    <br>
                    Official FreeSWITCH Sites<br>
                    <a href="http://www.freeswitch.org" target="_blank"
                      moz-do-not-send="true">http://www.freeswitch.org</a><br>
                    <a href="http://confluence.freeswitch.org"
                      target="_blank" moz-do-not-send="true">http://confluence.freeswitch.org</a><br>
                    <a href="http://www.cluecon.com" target="_blank"
                      moz-do-not-send="true">http://www.cluecon.com</a><br>
                    <br>
                    FreeSWITCH-users mailing list<br>
                    <a
                      href="mailto:FreeSWITCH-users@lists.freeswitch.org"
                      target="_blank" moz-do-not-send="true">FreeSWITCH-users@lists.freeswitch.org</a><br>
                    <a
                      href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users"
                      target="_blank" moz-do-not-send="true">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
                    UNSUBSCRIBE:<a
                      href="http://lists.freeswitch.org/mailman/options/freeswitch-users"
                      target="_blank" moz-do-not-send="true">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
                    <a href="http://www.freeswitch.org" target="_blank"
                      moz-do-not-send="true">http://www.freeswitch.org</a><o:p></o:p></p>
                </blockquote>
              </div>
            </div>
          </blockquote>
          <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
            <div>
              <p class="MsoNormal">_________________________________________________________________________<br>
                Professional FreeSWITCH Consulting Services:<br>
                <a href="mailto:consulting@freeswitch.org"
                  moz-do-not-send="true">consulting@freeswitch.org</a><br>
                <a href="http://www.freeswitchsolutions.com"
                  moz-do-not-send="true">http://www.freeswitchsolutions.com</a><br>
                <br>
                Official FreeSWITCH Sites<br>
                <a href="http://www.freeswitch.org"
                  moz-do-not-send="true">http://www.freeswitch.org</a><br>
                <a href="http://confluence.freeswitch.org"
                  moz-do-not-send="true">http://confluence.freeswitch.org</a><br>
                <a href="http://www.cluecon.com" moz-do-not-send="true">http://www.cluecon.com</a><br>
                <br>
                FreeSWITCH-users mailing list<br>
                <a href="mailto:FreeSWITCH-users@lists.freeswitch.org"
                  moz-do-not-send="true">FreeSWITCH-users@lists.freeswitch.org</a><br>
                <a
                  href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users"
                  moz-do-not-send="true">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
                UNSUBSCRIBE:<a
                  href="http://lists.freeswitch.org/mailman/options/freeswitch-users"
                  moz-do-not-send="true">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
                <a href="http://www.freeswitch.org"
                  moz-do-not-send="true">http://www.freeswitch.org</a><o:p></o:p></p>
            </div>
          </blockquote>
          <p class="MsoNormal"><br>
            <br>
            <br>
            <o:p></o:p></p>
          <pre>_________________________________________________________________________<o:p></o:p></pre>
          <pre>Professional FreeSWITCH Consulting Services:<o:p></o:p></pre>
          <pre><a href="mailto:consulting@freeswitch.org" moz-do-not-send="true">consulting@freeswitch.org</a><o:p></o:p></pre>
          <pre><a href="http://www.freeswitchsolutions.com" moz-do-not-send="true">http://www.freeswitchsolutions.com</a><o:p></o:p></pre>
          <pre><o:p> </o:p></pre>
          <pre>Official FreeSWITCH Sites<o:p></o:p></pre>
          <pre><a href="http://www.freeswitch.org" moz-do-not-send="true">http://www.freeswitch.org</a><o:p></o:p></pre>
          <pre><a href="http://confluence.freeswitch.org" moz-do-not-send="true">http://confluence.freeswitch.org</a><o:p></o:p></pre>
          <pre><a href="http://www.cluecon.com" moz-do-not-send="true">http://www.cluecon.com</a><o:p></o:p></pre>
          <pre><o:p> </o:p></pre>
          <pre>FreeSWITCH-users mailing list<o:p></o:p></pre>
          <pre><a href="mailto:FreeSWITCH-users@lists.freeswitch.org" moz-do-not-send="true">FreeSWITCH-users@lists.freeswitch.org</a><o:p></o:p></pre>
          <pre><a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" moz-do-not-send="true">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><o:p></o:p></pre>
          <pre>UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" moz-do-not-send="true">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><o:p></o:p></pre>
          <pre><a href="http://www.freeswitch.org" moz-do-not-send="true">http://www.freeswitch.org</a><o:p></o:p></pre>
        </blockquote>
        <p class="MsoNormal"><o:p> </o:p></p>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
<a class="moz-txt-link-abbreviated" href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://www.freeswitchsolutions.com">http://www.freeswitchsolutions.com</a>

Official FreeSWITCH Sites
<a class="moz-txt-link-freetext" href="http://www.freeswitch.org">http://www.freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://confluence.freeswitch.org">http://confluence.freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://www.cluecon.com">http://www.cluecon.com</a>

FreeSWITCH-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a>
UNSUBSCRIBE:<a class="moz-txt-link-freetext" href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</a>
<a class="moz-txt-link-freetext" href="http://www.freeswitch.org">http://www.freeswitch.org</a></pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Saludos / Regards / Cumprimentos
António Silva</pre>
  </body>
</html>