Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Updated using 4PSA automated script
Note

Applies to VoipNow 3 and higher!

In case of intensive incoming and outgoing traffic, depending on the number of calls processed by your server, the call_history and ast_cdr table might gather millions of records. As a result, the overall performance of the Call Reports page will slow down. 

Having SSD harddrives should improve the behavior of the Call Reports page, even though it will also trigger some problems. In this case, the easiest workaround would be deleting records that are older than X months or years.

Tip

We recommend that you check your country regulation regarding the mandatory period for keeping call records.

Step-by-step guide

Assuming you are using a CentOS server and your DB credentials on VoipNow credentials are in /etc/voipnow/.sqldb, follow the recommendations below.

Note

If you are not sure of what you are doing, it's recommended to do a backup of the call_history and ast_cdr tables either in a file, or through an import to a different database.

Deleting records older than X years

  1. Log in to MySQL with mysql -u <user> -p<password> voipnow. The user and password are in the file mentioned above.
  2. Then run the following command. It will delete records older than one year. If you want to delete records older than 2 years, replace 1 with 2.

    Shell
    DELETE FROM ast_cdr WHERE calldate < DATE_SUB(NOW(), INTERVAL 1 YEAR);
    DELETE FROM call_history WHERE cr_date < DATE_SUB(NOW(), INTERVAL 1 YEAR);

  3. To exit from MySQL, run: 

    Shell
    exit;

Deleting records older than Y months

  1. Log in to MySQL as explained above.
  2. Then run the following command. It will delete all records older than 6 months.

    Shell
    DELETE FROM ast_cdr WHERE calldate < DATE_SUB(NOW(), INTERVAL 6 MONTH);
    DELETE FROM call_history WHERE cr_date < DATE_SUB(NOW(), INTERVAL 6 MONTH);

Content by Label
showLabelsfalse
max5
spacescom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@5d4a10c1
sortmodified
showSpacefalse
reversetrue
typepage
labelscall reports MySQL voipnow
cqllabel in ("reports","mysql","voipnow","call") and type = "page" and space = "4PSAKB"

Page properties
hiddentrue
Related issues 

Except where otherwise noted, content in this space is licensed under a Creative Commons Attribution 4.0 International.