M4 Automatic CDR Export

From Kolmisoft Wiki
Jump to navigationJump to search

Automatic CDR Export allows to create periodic CDR Export tasks that will be executed automatically on configured time with specific query parameters. Exported data will be archived and sent via Email to User or specific Email address.

CDR Export Templates

Automatic CDR Export requires to create at least one CDR Export Template so be sure to create one before proceeding.

Automatic CDR Export

Automatic CDR export is configured in SETTINGS -> Billing -> CDR -> Export -> Automatic

Here you will find a list of already configured Automatic CDR Exports:

Mor automatic cdr export list.png

In this list you may active/deactive CDR export tasks, edit or delete existing tasks and create new ones by pressing Add new Automatic CDR Export.

Note that Last run at and Next run at are shown in timezone defined by Time Zone setting.

New Automatic CDR Export

Mor automatic cdr export create.png

When creating new Automatic CDR Export you will see two sections: Query and Settings.

Query section

This section is very similar to filters in Last Calls page. You can set various filters for CDR Export query. These filters work in the same way as they work in Last Call page therefore you may test you query in Last Calls page and if you are happy with result, set same parameters in this Query section.

Note that date filters (From and Till) are missing. These filters depend on CDR Export Repeat period and will be described bellow.

Settings section

Name

Name is only for information purposes. This name is shown in Automatic CDR Export list.

Time Zone

Time Zone is important setting and should be set correctly depending on situation. All other time related settings will use this Time Zone.

For example, if you want to generate daily CDR Export to your User who lives in specific region, let’s say London, you should set timezone to GMT (+00:00) London. This way User will get CDR data starting from 00:00:00 till 23:59:59 in User’s timezone.

Server and User may be in different timezones therefore it is important to set Time Zone to User’s timezone if you intend to generate CDR for this User.

Another thing to consider is when you set Start CDR Export at setting (will be described later). This variable will also depends on Time Zone setting. For example, maybe you server off-peer hours are 00:00:00 - 06:00:00, but in selected Time Zone off-peer hours may be different.

Repeat period

Repeat period defines how often CDR Export is executed and which period is used for data retrieval. For this reason Query section is missing From and Till.

Note that this setting depends on Time Zone variable.

Hourly

CDR export will be executed each hour. CDR data will correspond to whole previous hour.

For example, if CDR export was executed on 2016-11-11 10:00:00, then CDR will be for 2016-11-11 09:00:00 - 2016-11-11 09:59:59 period.

In other words, it will work as if you set From to 2016-11-11 09:00:00 and Till to 2016-11-11 09:59:59 in date filters.

Daily

CDR export will be executed each day. CDR data will correspond to whole previous day.

For example, if CDR export was executed on 2016-11-11 00:00:00, then CDR will be for 2016-11-10 00:00:00 - 2016-11-10 23:59:59 period.

Weekly

CDR export will be executed each week. CDR data will correspond to whole previous week.

For example, if CDR export was executed on 2016-11-14 00:00:00 (monday), then CDR will be for 2016-11-07 00:00:00 (monday) - 2016-11-13 23:59:59 (sunday) period. Data period is always monday - sunday.

Bi-weekly

CDR export will be executed each twice a month. CDR data will correspond either to 1-15 day of month or 16 - end of month.

For example, if CDR export was executed on 2016-11-16 00:00:00, then CDR will be for 2016-11-01 00:00:00 - 2016-11-15 23:59:59 period. If CDR export was executed on 2016-12-01 00:00:00, then CDR will be for 2016-11-16 00:00:00 - 2016-11-30 23:59:59 period.

Monthly

CDR export will be executed each month. CDR data will correspond to whole previous month.

For example, if CDR export was executed on 2016-11-01 00:00:00, then CDR will be for 2016-10-01 00:00:00 - 2016-10-31 23:59:59 period. Data period is always first day of the month - last day of the month (whole month).

Only once

CDR export will be executed on specific date and time. Also, in Query section two additional filters will be displayed - From and Till. These filters allow to specify date period for CDR Export query (in selected Time Zone).

Start CDR Export at

If you have selected Daily, Weekly, Bi-weekly or Monthly periods, you may select specific hours when Automatic CDR export should be executed. This is useful because you may choose off-peek hours. Automatic CDR Export is executed only during selected hour period.

If you have selected Only once period, you have to set full date (days and hours). This is because Only once is not periodic and should have specific date and time.

Things to consider:

  • Choose off-peek hours, this will reduce load on system;
  • Be carefull when midnight is selected (00:00) because User may start new Call just before midnight and that Call may last for more than an hour. In this case, you may want to start CDR export few hours after midnight so all User’s Calls have time to finish;
  • Hourly period may be inaccurate for the reason described above.

Note that this setting depends on Time Zone variable.

Template

Select which CDR Export Template to use.

Send CDR to

Select who should receive CDR Export. It can be either User or specific Email address. If User is selected then Email address will be taken from Users settings (make sure that User has email).

Also make sure that email sending is configured correctly.

CDRs will be archived and sent to User/Email.

If archive is sent successfully, User should receive success email which can be customised in Emails settings. CDR archive will be attached.

Note: archive size is limited to 10MB! If CDR archive is larger, then archive will not be sent via Email and User will receive error Email instead.

Next run at

In Automatic CDR Export list you should see Next run at column. This shows date and time (in selected Timezone) when CDR export will be executed.

What happens when you create new Automatic CDR Export? When CDR Export will be executed? It depends on Repeat period. New Automatic CDR Export is executed on next period. For example, if you have created Hourly Automatic CDR Export on 2016-11-11 09:11:45, then the first time CDR Export is executed will be on 2016-11-11 10:00:00.

If you have created Daily Automatic CDR Export on 2016-11-11 09:11:45, then the first time CDR Export is executed will be on 2016-11-12 00:00:00.

If you have created Monthly Automatic CDR Export on 2016-11-11 09:11:45, then the first time CDR Export is executed will be on 2016-12-01 00:00:00.

Of course hours may be different depending on Start CDR Export at, but the idea is that CDR Export is executed on next period, either it is next hour, next day, next week or next month.

File names

CDR Export output is a CSV file compressed in tgz archive. Filename is based on dates, for example if CDR Export was executed for 2016-11-01 00:00:00 - 2016-11-30 23:59:59 period, then file names will be:

CSV filename: MOR_CDR_export_20161122_000000_20161122_235959.csv
TGZ filename: MOR_CDR_export_20161122_000000_20161122_235959.tgz

CDR Export and performance

CDR Export is resource intensive task. Consider having as little Automatic CDR Export tasks as possible. Also shorter Repeat periods have better peformance.

It is advisable to set Start CDR Export at to off-peak hours. Also, Start CDR Export at allows to spread tasks across hours during the day.

How old CDR Export tasks are handled

There might be situations when script responsible for CDR Export functionality was not running for long time. What happens to all CDRs that were supposed to be generated during that time when script was not running? Only single CDR for latest period will be generated. This is done intentionally to prevent high amount of CDR Export tasks to run at a time.

For example, if Monthly CDR Export tasks was created on January but for some reason CDR Export script was not executed until November, then CDR Export for January-September will be skipped. Script will generate CDR Export for October and sets Next run at to December.

This logic does not apply to Only once period. All tasks with Only once period will be executed.

See also

CDR Export Templates
Emails Templates variables