<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p><tt>The new accounting system gives you a choice: a dialog-level
        approach, by enabling "cdr", which results in a single table row
        containing all relevant info for a CDR (start time, pick up
        time, end time, etc.) or a transaction-level approach which
        allows you to log each request that is relevant to your
        accounting.</tt></p>
    <p><tt>By enabling the "cdr" flag, and calling do_accounting() for
        both INVITEs and BYEs, you seem to be doing both dialog and
        transaction accounting at the same time, and the module silently
        discards the BYE.</tt></p>
    <p><tt>If you really need those BYEs in there, however, you can
        force them in with acc_db_request() instead. Mind you that they
        might get inserted before the INVITE rows, since the INVITE CDR
        is really only completed when the in-dialog BYE reply arrives.</tt></p>
    <p><tt>The documentation might use some updates to more clearly
        reflect the above, so thanks for the report!<br>
      </tt></p>
    <p><tt>Regards,</tt><br>
    </p>
    <pre class="moz-signature" cols="72">Liviu Chircu
OpenSIPS Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
    <div class="moz-cite-prefix">On 15.08.2017 15:52, Jonathan Mabrito
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAL4wWrjZTtZYptUKHO64xDdohFNO_-mbTpBR7HoorHstDVn05Q@mail.gmail.com">
      <div dir="ltr">HI Liviu,
        <div><br>
        </div>
        <div>I am not sure attachments work on this list system, so let
          me know if it doesn't. In the meantime...assuming they do, I
          am attaching a ~205KB  zip with the debug log. Just do a text
          search from the bottom of the log for "BYE" and you will see
          my last attempt. It was a inbound attempt from the PSTN to our
          PBX and I dialed +1 6504526830. I verified the INVITE was in
          the ACC table in the MYSQL database, but not the BYE.<br>
          <br>
          <div class="gmail_quote">
            <div dir="ltr">On Mon, Aug 14, 2017 at 12:28 PM Liviu Chircu
              <<a href="mailto:liviu@opensips.org"
                moz-do-not-send="true">liviu@opensips.org</a>> wrote:<br>
            </div>
            <blockquote class="gmail_quote" style="margin:0 0 0
              .8ex;border-left:1px #ccc solid;padding-left:1ex">
              <div text="#000000" bgcolor="#FFFFFF">
                <p><tt>Hi Jonathan,</tt></p>
                <p><tt>Tried to reproduce it on 2.3.1 - no success. Can
                    you also provide the debug logs between the last two
                    statements you posted?<br>
                  </tt></p>
                <p><tt>Regards,<br>
                  </tt></p>
                <pre class="m_-8221963957570281985moz-signature" cols="72">Liviu Chircu
OpenSIPS Developer
<a class="m_-8221963957570281985moz-txt-link-freetext" href="http://www.opensips-solutions.com" target="_blank" moz-do-not-send="true">http://www.opensips-solutions.com</a></pre>
              </div>
              <div text="#000000" bgcolor="#FFFFFF">
                <div class="m_-8221963957570281985moz-cite-prefix">On
                  11.08.2017 15:43, Jonathan Mabrito wrote:<br>
                </div>
              </div>
              <div text="#000000" bgcolor="#FFFFFF">
                <blockquote type="cite">
                  <div dir="ltr">I recently upgraded from OpenSIPS 2.2
                    to 2.3.1. Within the ACC module, I would get
                    accounting information in the DB on the INVITES and
                    the BYES on 2.2. After the upgrade to 2.3.1, I am
                    getting the INVITES, but not the BYES. I made the
                    adjustments per the migration guide for the
                    extra_fields modparam that was introduced.
                    <div><br>
                    </div>
                    <div>Here is the script clause I am using for BYE's:</div>
                    <div>
                      <div><i>                if(loose_route())</i></div>
                      <div><i><span style="white-space:pre-wrap">           </span>{</i></div>
                      <div><i><span style="white-space:pre-wrap">                   </span>xlog("Transaction
                          is a loose route \n");</i></div>
                      <div><i><br>
                        </i></div>
                      <div><i><span style="white-space:pre-wrap">                   </span>if(is_method("BYE")){</i></div>
                      <div><i><span style="white-space:pre-wrap">                           </span>#Accounting</i></div>
                      <div><i><span style="white-space:pre-wrap">                           </span>xlog("Processing
                          BYE Message")</i></div>
                      <div><i><span style="white-space:pre-wrap">                           </span>if((!($ru
                          =~ '<a
                            class="m_-8221963957570281985moz-txt-link-freetext"
                            moz-do-not-send="true">sip:05.*</a>'))
                          && (!($ru =~ '172.18.24.102.*'))
                          && (!($ru =~ '<a
                            class="m_-8221963957570281985moz-txt-link-abbreviated"
                            href="mailto:sip.*@172.18.24.102:5060"
                            target="_blank" moz-do-not-send="true">sip.*@172.18.24.102:5060</a>')))</i></div>
                      <div><i><span style="white-space:pre-wrap">                           </span>{</i></div>
                      <div><i>                                       
                          xlog("Processing BYE Accounting")</i></div>
                      <div><i><span style="white-space:pre-wrap">                                   </span>$acc_extra(FROM)
                          = $fu;</i></div>
                      <div><i><span style="white-space:pre-wrap">                                   </span>$acc_extra(TO)
                          = $tu;</i></div>
                      <div><i><span style="white-space:pre-wrap">                                   </span>$acc_extra(RULE)
                          = $avp(dr_rule_id);</i></div>
                      <div><i><span style="white-space:pre-wrap">                                   </span>$acc_extra(DEST)
                          = $avp(dr_gw_id);</i></div>
                      <div><i><span style="white-space:pre-wrap">                                   </span>$acc_extra(REQURI)
                          = $ru;</i></div>
                      <div><i><span style="white-space:pre-wrap">                                   </span>do_accounting("db",
                          "cdr|missed|failed", "acc");</i></div>
                      <div><i><span style="white-space:pre-wrap">                           </span>}</i></div>
                      <div><i><span style="white-space:pre-wrap">                   </span>}</i></div>
                      <div><i><br>
                        </i></div>
                      <div><i><span style="white-space:pre-wrap">                   </span>route(relay);</i></div>
                      <div><i><span style="white-space:pre-wrap">           </span>}</i></div>
                    </div>
                    <div><i><br>
                      </i></div>
                    <div>In the syslog, I see these 4 statements back to
                      back consecutively :</div>
                    <div>
                      <div><i>Aug 10 15:54:16 VOPS
                          /usr/sbin/opensips[8980]: Transaction is a
                          loose route</i></div>
                      <div><i>Aug 10 15:54:16 VOPS
                          /usr/sbin/opensips[8980]: Processing BYE
                          Message</i></div>
                      <div><i>Aug 10 15:54:16 VOPS
                          /usr/sbin/opensips[8980]: Processing BYE
                          Accounting</i></div>
                      <div><i>Aug 10 15:54:16 VOPS
                          /usr/sbin/opensips[8980]: route[relay]</i></div>
                    </div>
                    <div><i><br>
                      </i></div>
                    <div>So from what I can tell, when the BYE happens,
                      it is making it into the proper section of the
                      script. Any idea why the BYE isn't being
                      accounted?</div>
                    <div><i><br>
                      </i></div>
                    <div><i><br>
                      </i></div>
                  </div>
                  <div dir="ltr">-- <br>
                  </div>
                  <div class="m_-8221963957570281985gmail_signature"
                    data-smartmail="gmail_signature">
                    <div dir="ltr">-Jonathan</div>
                  </div>
                  <br>
                  <fieldset
                    class="m_-8221963957570281985mimeAttachmentHeader"></fieldset>
                  <br>
                </blockquote>
              </div>
              <div text="#000000" bgcolor="#FFFFFF">
                <blockquote type="cite">
                  <pre>_______________________________________________
Users mailing list
<a class="m_-8221963957570281985moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org" target="_blank" moz-do-not-send="true">Users@lists.opensips.org</a>
<a class="m_-8221963957570281985moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank" moz-do-not-send="true">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
                </blockquote>
                <br>
              </div>
              _______________________________________________<br>
              Users mailing list<br>
              <a href="mailto:Users@lists.opensips.org" target="_blank"
                moz-do-not-send="true">Users@lists.opensips.org</a><br>
              <a
                href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users"
                rel="noreferrer" target="_blank" moz-do-not-send="true">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
            </blockquote>
          </div>
        </div>
      </div>
      <div dir="ltr">-- <br>
      </div>
      <div class="gmail_signature" data-smartmail="gmail_signature">
        <div dir="ltr">-Jonathan</div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>