Questions about the asterisk-freepbx databases

Hello, good afternoon:

When I Install FreePBX from the FreePBX.ISO I can see that it is created 2 MySQL databases:

  • asteriskcdrdb
    I understand that on this database is it saved the info. related with the CDR (using odbc+mysl or only mysl) which is taken from the Asterisk dialplan (extensions.conf, etc).
    The “CDR reporting module” of FreePBX read only the info. which is written on MySQL asteriskcdrdb DB, true? It doesnt use the info of .csv, sqlite or postgree CDR’s, true?

  • asterisk
    What info. there is exactly on this database? what module is reading/writting on this database? in which cases is used this database, on the dialplan of Freepbx?

And another question, you can read/write on both MySQL databases directly or through ODBC connector, true? If I only use cdr_mysql.so and res_config_mysql.so (and dont use any module related with odbc, postgre and sqlite) on theory there is no problem related with the correct asterisk-freepbx working, true?

-asteriskcdrdb
You are mostly correct…ODBC is a connection method, MySQL is the database technology…you can’t use MySQL without first connecting to it so it is ODBC + MySQL.

-asterisk
This table holds a TON of information about the phone system; extensions, dial plans, time conditions, you name it. It is from this database that the config files for Asterisk get written by FreePBX. Basically, when you change something in the web GUI, it calls a function which does a bunch of stuff including writes new information to the database. The reason that you have an “apply changes” button is because in order for asterisk to see the changes, FreePBX needs to query the database, determine what config file changes to make, make them, and then reload asterisk.

Thanks by your response Overkill,

On theory if I use “cdr_mysql.so” I can obtain MySQL CDR info. without necessity of using “cdr_odbc.so”+MySQL or “cdr_adaptive_odbc.so”+MySQL, true?
By the way, on theory I can disable all the cdr modules except “cdr_mysql.so” and the reporting CDR module of freePBX will work fine, true? If I am not wrong the FreePBX CDR reporting module read the info only from MySQL, it doesnt read the info from .csv, Postgree, SQlite, etc, true?

By the other way, what modules are necessary for the correct working of freepbx with respect to the “asterisk” database? res_odbc.so is necessary? Or I can read/write on MySQL database “asterisk” from the FreePBX web interface without the necessity of any odbc-mysql-postgree-sqlite module?

By the way FreePBX web interface or any FreePBX module use SQlite or postgree??? Or only use MySQL?

Regards and thanks by your help

You shouldn’t need to modify anything from a default FreePBX install to get this to work.

You are correct about FreePBX not using CSV/etc

I don’t think it uses anything other than MySQL at all.

Hi again Overkill,

I am having problems with ODBC, my Asterisk-FreePBX PBX every X days crash and generates a coredump related with mysql and odbc with respect to cdr_odbc.so and res_odbc.so.

Because of this Im studying an alternative to avoid this problem like use cdr_mysql.so only.

I share with you the backtrace:

backtrace.tgz (301.5 KB)

Unfortunately this backtrace doesn’t make a whole lot of sense to me and I don’t see anywhere that a word like fatal, error, crash, dump, etc. comes up in a diagnostic context (the word error appears a few times but its always error = 0)

A correctly configured system won’t have this issue, which leads me to believe something is wrong with the system not the ODBC connectivity. I would recommend making a full backup of the system and doing a complete reinstall and restore if you don’t have the technical capacity to troubleshoot this, or hire somebody to try and find the root cause of the problem for you.

ODBC is “Open Data Base Connectivity” and was touted as a common method for connecting disparate database technologies to Windows. So, ODBC is a connector to ANY database technology.

It’s a layer above the native database, so (in this case) you can’t access ODBC without accessing the MySQL underneath. Think of it as a translator - it allows you to use ODBC (a common data access method) to get information from anything that ODBC can connect to.

Now, if the problem you are having is with cdr_odbc, you might need to look into reinstalling, There’s something wrong with your installation if this is core_dumping.

Adding CSV file storage to your system should be simple.

I’m not sure, but I think that cdr_mysql has been deprecated.