Problem with Asterisks/FreePBX ODBC

NethServer Version: NethServer release 7.9.2009 (final)
Kernel Release: 3.10.0-1160.15.2.el7.x86_64
Module: Asterisk 13.38.1 / FreePBX 14.0.16.4

I have some trouble with Asterisks/FreePBX database connection so the Error: “app_voicemail_odbcstorage.c:5901 inboxcount2: Failed to obtain database object for ‘asteriskcdrdb’!” repeats often.

“asterisk -rx “odbc show”” shows me there are no ODBC DSN Settings in Asterisk.

Compared with an testing installation i have found, that the “/etc/asterisk/res_odbc_additional.conf” of my installation ist “empty”, except the lines generated from FreePBX.

I would fill in the needed sections and informations like:
" [asteriskcdrdb]
enabled=>yes
dsn=>MySQL-asteriskcdrdb
pre-connect=>yes
max_connections=>5
username=>freepbxuser
password=>mysuperduperpasswordforthispost
database=>asteriskcdrdb"

but the edited config will overwritten from FreePBX.

As described in FreePBX Wiki, the based config file should be “/etc/odbc.ini”, but this file generates from e-smith in Nethserver. Now i am confused.

I cant find the e-smith template AND i cant find the source where e-smith gets the needed information for database connection like username and password for generating the config file.

Any suggestions?

Regards yummiweb

Thank you for lead me to this Informations. It is even better to read such things first before asking,
but in my case the answer isnt there or i cant find.

My “configuration db(s)” in both installation (normal and test installation) have no entries for the needed informations like username and password.

The entries for “MySQL-asteriskcdrdb” in BOTH installations are:
MySQL-asteriskcdrdb=odbc
Database=asteriskcdrdb
Description=ODBC on asteriskcdrdb
Driver=MySQL
Port=3306
Server=localhost

The entry in “/etc/asterisk/res_odbc_additional.conf” needs:
" [asteriskcdrdb]
enabled=>yes
dsn=>MySQL-asteriskcdrdb
pre-connect=>yes
max_connections=>5
username=>freepbxuser
password=>mysuperduperpasswordforthispost
database=>asteriskcdrdb"

Maybe in could write in the needed informations in configurations db now (like described in nethserver-unixODBC readme), but i dont think this would work in the right way.

Ether FreePBX or e-smith “expands” the needed informations (username and password) in the “/etc/asterisk/res_odbc_additional.conf” file, but i cant find his source (db) for username and password.

I have searched for “mysuperduperpasswordforthispost” and “myothersuperduperpasswordforthispost” in config files on both installations and found the password(s) here:
etc/asterisk/extensions_additional.conf
etc/amportal.conf
etc/freepbx.conf

The only different (file) is “etc/asterisk/res_odbc_additional.conf”, but this file is - like described -generated from somewhere. While this source seems to empty or non-exist in my installation, the ODBC DSN Settings in Asterisk are non-exist.

If i add the needed informations in “/etc/asterisk/res_odbc_additional.conf” direct, the ODBC DSN Settings in Asterisk are fine but lost after asterisks/freepbx restart (expanding, asterisks macros whatever).

The wiki.asterisks.org was not helpful until now. It describes to change the “/etc/odbc.ini”, but this file is managed from Nethserver e-smith and the configuration db. Maybe the nethserver-freepbx installation procedere differs also, so asking the Asterisks/FreePBX Forums seem the wrong way for me.

To find and fix such things by hand is rather and has more learning effect as an complete de- and re-installation. So maybe someone has informations for me to set the needed informations in the correct way to the correct place.

Regards yummiweb.

In-between i played around with my testing installation and have found that:

My nearly new FreePBX has shown in dashboard that the UCP node is nod running.
After reading some FreePBX community posts, a option should be to reinstall the UCP Module via module manager. So i have done that with “force download and install”.

This process have takes some time, but after then the “ODBC DSN Settings” in my test-installation was gone(!). The config file “/etc/asterisk/res_odbc_additional.conf” was empty now. Ups…

So i think, this behavior is maybe a problem with freepbx itself, not the nethserver-freepbx. What do you mean?

Sorry, I don’t know, I don’t use it.

Even after deinstallation and reinstallation (including deletion of all relevant program components, configuration files and databases) the problem is still the same. So I end my nethserver-freepbx experiment at this point and use FreePBX in a separate VM instead. Nevertheless many thanks!

Sorry to read that and that I missed this thread. Did you try to reconfigure nethserver-freepbx and maybe nethserver-unixODBC with signal-event nethserver-freepbx-update ?

No i didn’t tried this command because i haven’t read this nowhere in the docs.
But i think a have used /etc/e-smith/events/actions/system-adjust in this process.

Is the combination signal-event "$package-name"-update in general or mostly the way to reconfigure Nethserver services?

This reconfigures the whole server.

https://wiki.nethserver.org/doku.php?id=howto:useful_commands#reconfigure_the_server

Yes, it reconfigures a NethServer module.

Usually a nethserver-* module has an update event that completely reconfigures the package.

See nethserver-httpd for example and the docs about actions and events.