Hi Ketan,

I see all your accounting triggers are set for sequential requests only, for BYE, ACK and re-INVITE.

Please read this : http://www.opensips.org/Documentation/Tutorials-Advanced-Accounting

and decide if you want to do acc at call/dialog level or at transaction level.

Best regards,

Bogdan-Andrei Iancu
  OpenSIPS Founder and Developer
  http://www.opensips-solutions.com

On 09/27/2017 07:10 AM, Ketan Kothari wrote:
Hello Bogdan,

I'm using below script for opensips.

#### ACCounting module
loadmodule "acc.so"
modparam("acc", "db_table_acc", "acc")
/* what special events should be accounted ? */
modparam("acc", "early_media", 0)
modparam("acc", "report_cancels", 0)

/* by default we do not adjust the direct of the sequential requests.
   if you enable this parameter, be sure the enable "append_fromtag"
   in "rr" module */
modparam("acc", "detect_direction", 0)
modparam("acc", "db_url", "mysql://root:W7nS0kdbd4@localhost/opensips") # CUSTOMIZE ME
modparam("acc", "acc_method_column", "method")



#### UDP protocol
loadmodule "proto_udp.so"

####### Routing Logic ########

# main request routing logic

route{
    if (!mf_process_maxfwd_header("10")) {
        sl_send_reply("483","Too Many Hops");
        exit;
    }
force_rport();

    if (has_totag()) {
        # sequential requests within a dialog should
        # take the path determined by record-routing
        if (loose_route()) {

            if (is_method("BYE")) {
                # do accunting, even if the transaction fails
                do_accounting("log","failed");
                 do_accounting("db","missed","acc");
            } else if (is_method("INVITE")) {
                do_accounting("db","cdr","acc");
                # even if in most of the cases is useless, do RR for
# re-INVITEs alos, as some buggy clients do change route set
                # during the dialog.
                record_route();

            } else if ( is_method("ACK") ) {

do_accounting("db","missed","acc");
}


# route it out to whatever destination was set by loose_route()
            # in $du (destination URI).
            route(relay);
        } else {

            if ( is_method("ACK") ) {
do_accounting("db","missed","acc");
                if ( t_check_trans() ) {
# non loose-route, but stateful ACK; must be an ACK after
                    # a 487 or e.g. 404 from upstream server
                    t_relay();
                    exit;
                } else {
                    # ACK without matching transaction ->
                    # ignore and discard
                    exit;
                }
            }
            sl_send_reply("404","Not here");
        }
        exit;
    }

Please correct me if there is any issue  in script.


On Tue, Sep 26, 2017 at 10:14 PM, Bogdan-Andrei Iancu <[email protected] <mailto:[email protected]>> wrote:

    Hi,

    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 ?

    Best regards,

    Bogdan-Andrei Iancu
       OpenSIPS Founder and Developer
       http://www.opensips-solutions.com <http://www.opensips-solutions.com>

    On 09/26/2017 12:53 PM, Ketan Kothari wrote:
    Hello Khalil,

    Thanks for your response.

    I have checked in database there no records of calls.
    I'm using opensips 2.3.1 is there any document or sample of
    opensips.cfg for accounting.

    http://www.opensips.org/Documentation/Tutorials-Advanced-Accounting
    <http://www.opensips.org/Documentation/Tutorials-Advanced-Accounting>
    i have checked this link is last modified at November 03, 2016
    before opensips 2.3.1 release.

    So please suggest me if any doc available for newly version.




_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

Reply via email to