You are currently viewing Asterisk 13 mysql cdr

Asterisk 13 mysql cdr

About Asterisk 13 Mysql cdr

Asterisk 13 MySQL cdr can save CD-R files in a Mysql database, even instead of an alternate to CSV text data files and other database formats.

The Way You Can Obtain cdr_mysql

It truly is an essential component of both Asterisk 1.8 and high

You have to possess MySQL cdr along with MySQL-devel packs set up.

grep MySQL

To get Debian or alternative Dpkg-based methods, assess, for example, this:

pkg -Debian MySQL-server libmysqlclient*dev

In FreeBSD, You Will locate MySQL cdr from the vents library, /usr/ports/databases/mysql4-server


It truly is like a joint Asterisk cdr compilation

. /configure

create menu select

create install


Mysql. h Mistakes

Assess This creates a point in which There Aren’t Any MySQL.h mistakes, which implies You’re overlooking the MySQL-devel bundle

If create fails thanks to Asterisk 13 MySQL cdr whining of a lost” asterisk. h” document, you’ll be able to copy this document in the asterisk listing or even produce a link (“ln -so…”) for use/src/asterisk which counts into an asterisk supply listing.

Copy the sample configuration file /etc/asterisk/cdr_mysql.conf and edit it to your requirements. You can still restart Asterisk, and the restart will take effect immediately.

This is the database you utilize to put in Mysql cdr API to encourage charging.

Produce the database

For trunk variant since 29-dec 2007 needs to be:

Asterisk 13 Mysql cdr GRANT INSERT, SELECT…

due to the fact cdr_addon_mysql do DESC’cd are; to assess tables areas.

Tip: Copy and paste this SQL command into a text document, store it beneath a Suitable title, then implement the following command:

There is a problem with the CD-R back-end to MySQL when you use a dining table and a desk simultaneously. The MySQL CD-R back-end doesn’t operate if the dining table is made beneath a separate title. In v-1.2, the dining table is searchable through the”dining table ” solution in cdr_mysql. conf

Still another notice: ” It possibly is not a fantastic notion to use the InnoDB motor optimization. Asterisk 13 MySQL cdr maintains auto-commit switched on automagically; thus, just about every INSERT question is its transaction.

Mysql CDR

This may create the question to take much more time to execute. In my private pc, the”clock period” penalty is about 4 7 days that of MyISAM to the null default context varchar 80 00 clid varchars 80 Ubuntu setup. Please be aware the cd r dining table doesn’t need precisely the characteristics the InnoDB motor gives.

Dec. 2007: After reading through the SVN commit logs, I found that Tilghman has given a switch allowing MySQL to compose random pillar titles. This gets through the ODBC motorist for a while. However, it did, maybe not, at the MySQL driver. It’s now just accessible back (what’ll end up 1.6), but someone will compose a backport.

The module was fully revamped, using a few options from the config document no further utilized and an extra brand new element referred to as [aliases]. Please browse the sample config to get familiar with those alterations.


This module allows random columns to be generated and then inhabited, just like MySQL cdr_adaptive_odbc. Add the pillar to the desk, along with the appropriate CD-R (). Alias is possibly utilized to specify connections between differently-named factors and columns (like the call date column and the beginning CD-R factor ).

Asterisk 13 MySQL CDR (sample arrangement) explains that the call-date column works by using the phone’s start time rather than the older and more traditional method of working with end times. But, you can find the older behavior for call date by simply altering the alias into”ending => call date.”

You can even get rid of conventional columns today by simply removing the name of the pillar from the desk and gluing it. Or, you could alias the surname using a Non-variable (e.g., foo => am flagged).

Q:” The “unique” discipline isn’t currently populated at the MySQL cdr D B. Can it be an obsolete area, or is it an insect?

A: you’ll want to specify MYSQL_LOGUNIQUEID at the compile period to utilize this industry.

You’ve got just two choices in /usr/src/asterisk-addons:

VoIP termination rates provider - My Country Mobile


Inch. Or add a #define MYSQL_LOGUNIQUEID on the top of cdr_addon_mysql.c.

Finally, do the normal create tidy, make, make setup? Remember to look at the Makefile for your clear presentation of the flag following a CVS upgrade! You’ll probably also desire an indicator that the unique discipline on your Asterisk 13 MySQL CD-R desk enhances functionality. See also bulk sms.

You Will Also Need to Bring a unique id’ number column into your MySQL database following the account code’ column:

What could I want this all to? As an instance, you’re operating an AGI script and also might like to associate AGI info together with all the Asterisk 13 MySQL selected from cdr dining tables.

AGI Scripts

The problem is that AGI scripts may lose a connection to the telephone after the caller has hung up. Therefore, you will need to be able to detect the CD-R entry. (This will also be generated right after the telephone was rung).

Care! The unique discipline guarantees to be separate round different Asterisk 13 MySQL cdr entrances, but though the title implies that. In reality, Unique id never ensures to be unique throughout all cd-rs: It’s just specific throughout a station, along with a channel that may have numerous cd-rs.

Asterisk 13 Mysql cdr various types are invalid default types null default lastapp varchar, null default 0000-00-00 00, null default lastdata varchar, null default-src varchar, default DST varchar 80, null default DST varchar.

And not null defaults are 80 not null default, default-src varchar 80, DateTime not null default, 32 not null default.

My Country Mobile is also Specialized in different products like Virtual Phone Number, DID Numbers, Local Phone Numbers, and Business Phone Numbers.

My Country Mobile also specializes in USA virtual phone numbers, such as 939 area code, 430 area code, 661 area code, and  Know More about it Bulk SMS Business Continuity and Astrocom.