CDR-Stats 1.3.0 released

Star2Billing are pleased to announce the release of CDR-Stats 1.3

CDR-stats is a replacement for Asterisk-Stats, first released over eight years ago by Areski, The Author of CDR-Stats. Anyone who has used the Call Data Reports in FreePBX will be familiar with Asterisk-Stats as this forms the core of CDR reporting in FreePBX.

CDR-Stats allows reports to be generated in different formats over varying time periods with filters and graphs to compare periods of traffic.

Version 1.3 of CDR-Stats includes a number of enhancements such as providing ACL access to CDR so that users can be controlled in what they are allowed to see. There is more information, screen prints and instructions at http://www.cdr-stats.org

Many of the FreePBX aggregations do not implement ACL access, so if a PBX administrator wants to give access to users to inspect the PBX CDR, then access to the whole PBX is unavoidable, therefore installing CDR-Stats alongside an existing system will allow users to analyse their CDR without compromising the rest of the configuration.

A script to install CDR-Stats on CentOS / Asterisk / FreePBX or Asterisk-Stats systems has been included to make installation quick and easy for users of AsteriskNow, Trixbox, Elastix, and PBX in a Flash.

We invite you to download and install CDR-Stats. If you have any difficulties, or need assistance with the installation, then commercial support is available from Star2Billing.

Yours

Areski, Joe and the Star2Billing Team
http://www.star2billing.com/

36 Comments

  1. Hello, it’s possibile to use cdr-stats with postgresql or mysql db instead of sqlite?
    i have a python script tha store my traditional pbx into postgresql and i’d like to use cdr-stats for manage the data.

    Thanks

    Paolo

  2. yes of course, it suppose to work with mysql and postgresql too.
    But I never tested with postgresql, nevertheless the ORM should work
    fine with it.

    Yours,
    /Areski

  3. Hi, first of all thanks for your great work.

    I was nearly able to get cdr-stats running on gentoo with mysql but got stuck on some database issues. I read the install instructions and analyzed all installation scripts but cannot find any information about some additional database tables.

    When I start cdr-stats and try to login I get:
    (1146, “Table ‘asterisk.auth_user’ doesn’t exist”)

    When I try to select a different language I get:
    (1146, “Table ‘asterisk.django_session’ doesn’t exist”)

    So there seem to be more databases than the cdr database but I cannot find any related information. Can you give me some further information. I appreciate any help.

    Regards
    Stefan

  4. You might have miss a test in the installation.
    try to run :
    python manage.py syncdb
    that will create the missing tables.

    We will be delighted if you share a post, on your blog or even here to tell people how to install it on Gento.

    Cheers,
    /Areski

  5. Can this do scheduled reports?

  6. Not at the moment, but it might not be too hard to add!

  7. Hello, I’m testing but option “Export CSV file” gives me “Error 500”, what can I verify?

    Thanks!

  8. Hello,

    First of all, congrats on the software! Really nice!

    I have been struggling a little to install, but using your script with a couple of changes, I was able to finally get it running.

    Every thing works fine so far, I only get an error 500 when I try the Global Report.

    I am using version 1.3 instead of 1.4.

    How can I figure out the error?

  9. On top of settings.py you will find few lines which should be set as follow :
    DEBUG = True
    TEMPLATE_DEBUG = DEBUG

    Please share the fixed you had to do on the install script.

    Yours,
    /Areski

  10. Cdr-stats installed using the script available on the site, but I am not able to open the application via the web, Forbidden error is returned.

    Can you help me?

  11. Where do I post the fix?

  12. Hello. Very nice software!
    I receive “Error 500” when I try the search CDR. All the others are OK! I change

    DEBUG = True
    TEMPLATE_DEBUG = DEBUG

    but nothing.

    Thank you,

    Ilias

  13. In a try to access “Search CDR” i receive these:

    Mod_python error: “PythonHandler django.core.handlers.modpython”

    Traceback (most recent call last):

    File “/usr/lib/python2.4/site-packages/mod_python/apache.py”, line 299, in HandlerDispatch
    result = object(req)

    File “/usr/lib/python2.4/site-packages/django/core/handlers/modpython.py”, line 213, in handler
    return ModPythonHandler()(req)

    File “/usr/lib/python2.4/site-packages/django/core/handlers/modpython.py”, line 191, in __call__
    response = self.get_response(request)

    File “/usr/lib/python2.4/site-packages/django/core/handlers/base.py”, line 182, in get_response
    response = self.handle_uncaught_exception(request, resolver, sys.exc_info())

    File “/usr/lib/python2.4/site-packages/django/core/handlers/base.py”, line 203, in handle_uncaught_exception
    return debug.technical_500_response(request, *exc_info)

    File “/usr/lib/python2.4/site-packages/django/views/debug.py”, line 59, in technical_500_response
    html = reporter.get_traceback_html()

    File “/usr/lib/python2.4/site-packages/django/views/debug.py”, line 151, in get_traceback_html
    return t.render(c)

    File “/usr/lib/python2.4/site-packages/django/template/base.py”, line 123, in render
    return self._render(context)

    File “/usr/lib/python2.4/site-packages/django/template/base.py”, line 117, in _render
    return self.nodelist.render(context)

    File “/usr/lib/python2.4/site-packages/django/template/base.py”, line 744, in render
    bits.append(self.render_node(node, context))

    File “/usr/lib/python2.4/site-packages/django/template/debug.py”, line 73, in render_node
    result = node.render(context)

    File “/usr/lib/python2.4/site-packages/django/template/defaulttags.py”, line 311, in render
    return self.nodelist_true.render(context)

    File “/usr/lib/python2.4/site-packages/django/template/base.py”, line 744, in render
    bits.append(self.render_node(node, context))

    File “/usr/lib/python2.4/site-packages/django/template/debug.py”, line 73, in render_node
    result = node.render(context)

    File “/usr/lib/python2.4/site-packages/django/template/defaulttags.py”, line 76, in render
    output = self.nodelist.render(context)

    File “/usr/lib/python2.4/site-packages/django/template/base.py”, line 744, in render
    bits.append(self.render_node(node, context))

    File “/usr/lib/python2.4/site-packages/django/template/debug.py”, line 73, in render_node
    result = node.render(context)

    File “/usr/lib/python2.4/site-packages/django/template/defaulttags.py”, line 236, in render
    return nodelist.render(context)

    File “/usr/lib/python2.4/site-packages/django/template/base.py”, line 747, in render
    return mark_safe(”.join([force_unicode(b) for b in bits]))

    TemplateSyntaxError: Caught MemoryError while rendering:

    My system has Centos 5.5, Asterisk 1.6.18.1 and Freepbx 2.8.1.4.
    I install CDR-stats 1.3 using the instal-script for Freepbx

  14. As you posted I guess this is fixed

  15. Are you very limited in memory ?

  16. My error:

    Mod_python error: “PythonHandler django.core.handlers.modpython”

    Traceback (most recent call last):

    File “/usr/lib/python2.4/site-packages/mod_python/apache.py”, line 299, in HandlerDispatch
    result = object(req)

    File “/usr/lib/python2.4/site-packages/django/core/handlers/modpython.py”, line 228, in handler
    return ModPythonHandler()(req)

    File “/usr/lib/python2.4/site-packages/django/core/handlers/modpython.py”, line 191, in __call__
    self.load_middleware()

    File “/usr/lib/python2.4/site-packages/django/core/handlers/base.py”, line 42, in load_middleware
    raise exceptions.ImproperlyConfigured, ‘Error importing middleware %s: “%s”‘ % (mw_module, e)

    ImproperlyConfigured: Error importing middleware django.middleware.common: “No module named generator”

    Centos, py2.4

    Can u help me?

  17. I think you might have miss to install the dependencies from the requirements file.

  18. Yes it might be easy to hack the code in order to do this.
    You might be willing to get a go to django.

    Yours,
    /Areski

  19. Yes this is certainly possible.
    You might also be willing to get a go at django and hack the code to accomplish this.

    Yours,
    /Areski

  20. Hello,

    Is it possible to add phone numbers to the groups (a certain user can only see certain numbers).

    Example: so a user would belong to a group, which has in it the following phone numbers:

    100, 101, 102, 103, 104.

    And the user can only see these numbers in the CDR ( if source or destination contains these exact numbers)?

  21. I might advice you to attach the right accountcode to the call, so that it appears in the CDR table.
    Once you can this sorted you can defined user account per accountcode and so filter the panel per user calls.

    Yours,
    /Areski

  22. Hello!
    There are more than 4500 calls a day in a database (asterisk as a platform).
    When “Search CDR” is chosen, an error occurs(in the time of processing, one of 4 3GHz cores is using completely, memory not so much):

    [Wed Aug 17 09:37:12 2011] [error] [client 192.168.1.131] Traceback (most recent call last):
    [Wed Aug 17 09:37:12 2011] [error] [client 192.168.1.131] File “/usr/local/lib/python2.6/dist-packages/django/core/handlers/wsgi.py”, line 273, in __call__
    [Wed Aug 17 09:37:12 2011] [error] [client 192.168.1.131] response = self.get_response(request)
    [Wed Aug 17 09:37:12 2011] [error] [client 192.168.1.131] File “/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py”, line 182, in get_response
    [Wed Aug 17 09:37:12 2011] [error] [client 192.168.1.131] response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
    [Wed Aug 17 09:37:12 2011] [error] [client 192.168.1.131] File “/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py”, line 203, in handle_uncaught_exception
    [Wed Aug 17 09:37:12 2011] [error] [client 192.168.1.131] return debug.technical_500_response(request, *exc_info)
    [Wed Aug 17 09:37:12 2011] [error] [client 192.168.1.131] File “/usr/local/lib/python2.6/dist-packages/django/views/debug.py”, line 59, in technical_500_response
    [Wed Aug 17 09:37:12 2011] [error] [client 192.168.1.131] html = reporter.get_traceback_html()
    [Wed Aug 17 09:37:12 2011] [error] [client 192.168.1.131] File “/usr/local/lib/python2.6/dist-packages/django/views/debug.py”, line 151, in get_traceback_html
    [Wed Aug 17 09:37:12 2011] [error] [client 192.168.1.131] return t.render(c)
    [Wed Aug 17 09:37:12 2011] [error] [client 192.168.1.131] File “/usr/local/lib/python2.6/dist-packages/django/template/base.py”, line 123, in render
    [Wed Aug 17 09:37:12 2011] [error] [client 192.168.1.131] return self._render(context)
    [Wed Aug 17 09:37:12 2011] [error] [client 192.168.1.131] File “/usr/local/lib/python2.6/dist-packages/django/template/base.py”, line 117, in _render
    [Wed Aug 17 09:37:12 2011] [error] [client 192.168.1.131] return self.nodelist.render(context)
    [Wed Aug 17 09:37:12 2011] [error] [client 192.168.1.131] File “/usr/local/lib/python2.6/dist-packages/django/template/base.py”, line 744, in render
    [Wed Aug 17 09:37:12 2011] [error] [client 192.168.1.131] bits.append(self.render_node(node, context))
    [Wed Aug 17 09:37:12 2011] [error] [client 192.168.1.131] File “/usr/local/lib/python2.6/dist-packages/django/template/debug.py”, line 73, in render_node
    [Wed Aug 17 09:37:12 2011] [error] [client 192.168.1.131] result = node.render(context)
    [Wed Aug 17 09:37:12 2011] [error] [client 192.168.1.131] File “/usr/local/lib/python2.6/dist-packages/django/template/defaulttags.py”, line 311, in render
    [Wed Aug 17 09:37:12 2011] [error] [client 192.168.1.131] return self.nodelist_true.render(context)
    [Wed Aug 17 09:37:12 2011] [error] [client 192.168.1.131] File “/usr/local/lib/python2.6/dist-packages/django/template/base.py”, line 744, in render
    [Wed Aug 17 09:37:12 2011] [error] [client 192.168.1.131] bits.append(self.render_node(node, context))
    [Wed Aug 17 09:37:12 2011] [error] [client 192.168.1.131] File “/usr/local/lib/python2.6/dist-packages/django/template/debug.py”, line 73, in render_node
    [Wed Aug 17 09:37:12 2011] [error] [client 192.168.1.131] result = node.render(context)
    [Wed Aug 17 09:37:12 2011] [error] [client 192.168.1.131] File “/usr/local/lib/python2.6/dist-packages/django/template/defaulttags.py”, line 76, in render
    [Wed Aug 17 09:37:12 2011] [error] [client 192.168.1.131] output = self.nodelist.render(context)
    [Wed Aug 17 09:37:12 2011] [error] [client 192.168.1.131] File “/usr/local/lib/python2.6/dist-packages/django/template/base.py”, line 744, in render
    [Wed Aug 17 09:37:12 2011] [error] [client 192.168.1.131] bits.append(self.render_node(node, context))
    [Wed Aug 17 09:37:12 2011] [error] [client 192.168.1.131] File “/usr/local/lib/python2.6/dist-packages/django/template/debug.py”, line 73, in render_node
    [Wed Aug 17 09:37:12 2011] [error] [client 192.168.1.131] result = node.render(context)
    [Wed Aug 17 09:37:12 2011] [error] [client 192.168.1.131] File “/usr/local/lib/python2.6/dist-packages/django/template/defaulttags.py”, line 236, in render
    [Wed Aug 17 09:37:12 2011] [error] [client 192.168.1.131] return nodelist.render(context)
    [Wed Aug 17 09:37:12 2011] [error] [client 192.168.1.131] File “/usr/local/lib/python2.6/dist-packages/django/template/base.py”, line 747, in render
    [Wed Aug 17 09:37:12 2011] [error] [client 192.168.1.131] return mark_safe(”.join([force_unicode(b) for b in bits]))
    [Wed Aug 17 09:37:12 2011] [error] [client 192.168.1.131] TemplateSyntaxError: Caught MemoryError while rendering:

    Do you have any advices how to fix it?
    Maybe it would be slower but with final result.
    Thanks.

  23. If you have this error:
    TemplateSyntaxError: Caught MemoryError while rendering:
    in process of “Search CDR” request – you possibly can overcome it if you will use smaller time period. Just decrease period by changing “to_date” in cdr/views.py.

  24. You should have criteria that might allow you to define the date selection, that doesn’t do the trick.
    We obviously should do more optimization on this part to handle higher number of CDR

  25. Ok I see you previous message and now it’s clear.
    We need to improve this reporting.

    Yours,
    /Areski

  26. Hi!
    Is it hard to add “Disposition” field in “Daily Traffic” to form graphs only by e.g. “ANSWERED” calls?

    It would be convenient to form csv file only by search result in “Search CDR”. Is it possible?

    Thanks.

  27. Hello I downloaded and have been working on version 1.4 of CDR-STATS, several features have changed, but I can not force the Spanish format dates (d-m-Y), I’ve tried to i18n, i10n, forcing the javascript locate without results any, would this possible and if so could send me some example, thank you very much

  28. It’s not possible at the moment to change the date format but we will think of adding this in our next version.

  29. Thanks for your quick response, other issues can be changed to “monthly traffic” the result in number of calls, not duration?, How could I add in “search cdr” channel field to do research? . I changed some original fields to search “context” for favorable give me your e-mail to send it, revise it and keep it in mind for future versions, thanks

  30. Thanks for your response, I have found errors on the page “monthly traffic” data for the current month appear in the left side with the name “undefinined” it is possible to correct this ..You can send the code to fix, thank you. Attached image at this link, thank you. Attached image at this link

    http://www.flapsystem.com/downloads/lastmonth.png

  31. We are using MySQL to store the CDR information from asterisk. Our custom setup requires that the CDR be located in a database that houses a lot of other stuff besides the CDR. I’m trying to get cdr-stats to use its own mysql DB as defined in settings.py but then access the cdr table from our other DB (same server).

    I’ve tried changing the CDR_TABLE_NAME variable from ‘cdr’ to otherdb.cdr but it doesn’t appear to work.

    Any other ideas? Not a python guy, at all! Thank you so much!
    SB

  32. Hi Stephen,

    CDR_TABLE_NAME define the table only not the database, so you will have to change the database to which you connect to achieve this.

    With the current version of CDR-Stats, it’s important the CDR schema is as the default one of Asterisk. If you change fields it will not work.

    We have a new version on the way, which is a complete rewrite using MongoDB, I hope this will come out in the next week, you will have more flexibility to match any CDR tables from various DB engine (MYSQL, etc…)

  33. Thanks for the quick reply.

    My understanding is that all of the cdr-stats DB tables need to be in a database defined in settings.py (these are the tables that control access, users, etc)I have this defined as a DB on my server called cdrstats.

    The actual CDR table though exists another db (we’ll say otherdb) and is used as part of our product offering (or I would just move it to cdrstats)

    If I import all the cdrstats data into otherdb it works fine and accesses the CDR table as expected, but I don’t want all the cdrstats tables in with our primary production DB.

    is there a way in settings to define multiple DBs and point cdrstats to one and the CDR table to another? They are both on the same server, just different DB names.

    Thank you,
    SB

  34. Hi,
    You could create a mysql view of the distant database table, that should work!

    Nevertheless the next version coming will allow you to define a hook to import CDRs to mongoDB.

    So you will end up with 3 Databases:
    – Your CDR tables (otherdb) with your other stuff
    – Our CDR Mysql/Psql/Sqlite database for the user management, etc…
    – MongoDB, to store the reporting data and the CDR imported from otherdb

  35. Perfect! Had not seen \view\ before, looks like that does the trick for me! Thanks for all the help and I can’t wait for the next version! Great product already!

    S