<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi Ketan,<br>
    <br>
    I see all your accounting triggers are set for sequential requests
    only, for BYE, ACK and re-INVITE.<br>
    <br>
    Please read this :
    <a class="moz-txt-link-freetext" href="http://www.opensips.org/Documentation/Tutorials-Advanced-Accounting">http://www.opensips.org/Documentation/Tutorials-Advanced-Accounting</a><br>
    <br>
    and decide if you want to do acc at call/dialog level or at
    transaction level.<br>
    <br>
    Best regards,<br>
    <pre class="moz-signature" cols="72">Bogdan-Andrei Iancu
  OpenSIPS Founder and 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 09/27/2017 07:10 AM, Ketan Kothari
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAGqqW9_MCMMf9h+D53uqQ5hJmQNQAx=A5gF1iioMk=APCW_gpg@mail.gmail.com">
      <div dir="ltr">
        <div>Hello Bogdan,<br>
          <br>
        </div>
        I'm using below script for opensips.<br>
        <div><br>
          <span style="color:rgb(0,0,255)">#### ACCounting module<br>
            loadmodule "acc.so"<br>
            modparam("acc", "db_table_acc", "acc")<br>
            /* what special events should be accounted ? */<br>
            modparam("acc", "early_media", 0)<br>
            modparam("acc", "report_cancels", 0)<br>
            <br>
            /* by default we do not adjust the direct of the sequential
            requests.<br>
               if you enable this parameter, be sure the enable
            "append_fromtag"<br>
               in "rr" module */<br>
            modparam("acc", "detect_direction", 0)<br>
            modparam("acc", "db_url",
            "mysql://root:W7nS0kdbd4@localhost/opensips") # CUSTOMIZE ME<br>
            modparam("acc", "acc_method_column", "method")<br>
            <br>
            <br>
            <br>
            #### UDP protocol<br>
            loadmodule "proto_udp.so"<br>
            <br>
            ####### Routing Logic ########<br>
            <br>
            # main request routing logic<br>
            <br>
            route{<br>
                if (!mf_process_maxfwd_header("10")) {<br>
                    sl_send_reply("483","Too Many Hops");<br>
                    exit;<br>
                }<br>
            force_rport();<br>
                   <br>
                if (has_totag()) {<br>
                    # sequential requests within a dialog should<br>
                    # take the path determined by record-routing<br>
                    if (loose_route()) {<br>
                        <br>
                        if (is_method("BYE")) {<br>
                            # do accunting, even if the transaction
            fails<br>
                            do_accounting("log","failed");<br>
                             do_accounting("db","missed","acc");<br>
                        } else if (is_method("INVITE")) {<br>
                            do_accounting("db","cdr","acc");<br>
                            # even if in most of the cases is useless,
            do RR for<br>
                            # re-INVITEs alos, as some buggy clients do
            change route set<br>
                            # during the dialog.<br>
                            record_route();<br>
            <br>
                        } else if ( is_method("ACK") ) {<br>
            <br>
            do_accounting("db","missed","acc");<br>
            }<br>
            <br>
            <br>
                        # route it out to whatever destination was set
            by loose_route()<br>
                        # in $du (destination URI).<br>
                        route(relay);<br>
                    } else {<br>
                        <br>
                        if ( is_method("ACK") ) { <br>
            do_accounting("db","missed","acc");<br>
                            if ( t_check_trans() ) {<br>
                                # non loose-route, but stateful ACK;
            must be an ACK after <br>
                                # a 487 or e.g. 404 from upstream server<br>
                                t_relay();<br>
                                exit;<br>
                            } else {<br>
                                # ACK without matching transaction -><br>
                                # ignore and discard<br>
                                exit;<br>
                            }<br>
                        }<br>
                        sl_send_reply("404","Not here");<br>
                    }<br>
                    exit;<br>
                }</span><br>
          <br>
        </div>
        <div>Please correct me if there is any issue  in script.</div>
        <div><br>
        </div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Tue, Sep 26, 2017 at 10:14 PM,
          Bogdan-Andrei Iancu <span dir="ltr"><<a
              href="mailto:bogdan@opensips.org" target="_blank"
              moz-do-not-send="true">bogdan@opensips.org</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div bgcolor="#FFFFFF" text="#000000"> <tt>Hi,<br>
                <br>
                If you do not have any records in DB, it means OpenSIPS
                is not generating any acc data. Assuming you have
                ongoing calls, what is the way you trigger the
                accounting in your OpenSIPS script ?<br>
                <br>
                Best regards,<br>
              </tt>
              <pre class="m_8041286673913526759moz-signature" cols="72">Bogdan-Andrei Iancu
  OpenSIPS Founder and Developer
  <a class="m_8041286673913526759moz-txt-link-freetext" href="http://www.opensips-solutions.com" target="_blank" moz-do-not-send="true">http://www.opensips-solutions.<wbr>com</a>
</pre>
              <div>
                <div class="h5">
                  <div class="m_8041286673913526759moz-cite-prefix">On
                    09/26/2017 12:53 PM, Ketan Kothari wrote:<br>
                  </div>
                  <blockquote type="cite">
                    <div dir="ltr">
                      <div>
                        <div>
                          <div>
                            <div>Hello Khalil,<br>
                              <br>
                            </div>
                            Thanks for your response.<br>
                            <br>
                          </div>
                          I have checked in database there no records of
                          calls.<br>
                        </div>
                        I'm using opensips 2.3.1 is there any document
                        or sample of opensips.cfg for accounting.<br>
                        <br>
                         <a
href="http://www.opensips.org/Documentation/Tutorials-Advanced-Accounting"
                          target="_blank" moz-do-not-send="true">http://www.opensips.org/Docum<wbr>entation/Tutorials-Advanced-<wbr>Accounting</a>
                        i have checked this link is last modified at
                        November 03, 2016 before opensips 2.3.1 release.<br>
                        <br>
                      </div>
                      So please suggest me if any doc available for
                      newly version.<br>
                      <div><br>
                        <br>
                      </div>
                    </div>
                    <div class="gmail_extra"><br>
                    </div>
                  </blockquote>
                </div>
              </div>
            </div>
          </blockquote>
        </div>
      </div>
    </blockquote>
    <br>
  </body>
</html>