[OpenSIPS-Users] No data in CDR viewer

Ketan Kothari kkothari157 at gmail.com
Wed Sep 27 00:10:50 EDT 2017


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 <bogdan at opensips.org>
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
>
> 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 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.
>
>
>
> On Tue, Sep 26, 2017 at 3:11 PM, Khalil Khamlichi <
> khamlichi.khalil at gmail.com> wrote:
>
>> Hi,
>>
>> honestly, I never used the opensips GUI, but I think you need first check
>> the database tables ; acc and missed_calls and and see if there are any
>> records in there. then you could activate logging on mysql and see what
>> queries are being run when you click that button, then third step you need
>> to check apache/php logs there must be an error or an indication in there.
>> if no luck you surely just need to re-read this http://www.opensips.org/D
>> ocumentation/Tutorials-Advanced-Accounting , it explains everything, you
>> have noway to get lost if you just read carefully.
>>
>> hope this helps.
>>
>> kkh
>>
>>
>> On Tue, Sep 26, 2017 at 11:26 AM, Ketan Kothari <kkothari157 at gmail.com>
>> wrote:
>>
>>> Hello Guys,
>>>
>>> Is there any suggestion on this issue?
>>>
>>> On Fri, Sep 22, 2017 at 3:21 PM, Ketan Kothari <kkothari157 at gmail.com>
>>> wrote:
>>>
>>>> Hello Guy,
>>>>
>>>> I'm using opensips 2.3.1 and when i click on system --> *CDRviewer*
>>>> its showing *"no data found*".
>>>> Is there any suggestion to resolve this issue?
>>>>
>>>> [image: Inline image 1]
>>>>
>>>> my *opensips.cfg* file :https://pastebin.com/jFP8xxRF
>>>>
>>>
>>>
>>> _______________________________________________
>>> Users mailing list
>>> Users at lists.opensips.org
>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>
>>>
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>
>
>
> _______________________________________________
> Users mailing listUsers at lists.opensips.orghttp://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20170927/3acdbf76/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: opensips-cp.png
Type: image/png
Size: 25819 bytes
Desc: not available
URL: <http://lists.opensips.org/pipermail/users/attachments/20170927/3acdbf76/attachment-0001.png>


More information about the Users mailing list