Module cdr_adaptive_odbc.so not found

Hello everyone,

I want to load the module cdr_adaptive_odbc.so in order to store Call Detail Records but I have seen this log:

"module reload cdr_adaptive_odbc.so" No such module 'cdr_adaptive_odbc.so'

So I want to know how can I fix this?

Thank you for your answers :smile:

If you used a package, contact the package builder.

Otherwise, run menuconfig, identify the missing dependencies, provide them, and recompile.

When I run menuconfig, this message appears:

make menuconfig make: *** No rule to make target `menuconfig'. Stop.

You are probably running it in the wrong directory. The normal way of running it is to enter:

make menuconfig

when you are in the root directory of the source tree (and after you have run ./configure.

I am actually running on the root directory:

[asterisk@UAGENQFRASEXC07 /]$ ./configure -bash: ./configure: No such file or directory [asterisk@UAGENQFRASEXC07 /]$ make menuconfig make: *** No rule to make target `menuconfig'. Stop.

You don’t have the Asterisk source tree in your current directory.

Oh really, how can you say that?

Is there any other ways for loading the module cdr_adaptive_odbc.so?

If it is missing, you need to build it (or obtain it from a compatible package) before you can load it. You cannot load a module that isn’t present on the machine.

How did you install Asterisk in the first place?

I have installed Asterisk with the packages with yum command and officials repositories.

If it can help you:

[code]UAGENQFRASEXC07*CLI> cdr show status

Call Detail Record (CDR) settings

Logging: Enabled
Mode: Simple
Log unanswered calls: No
Log congestion: No

  • Registered Backends

    csv
    cdr_manager (suspended)
    cdr-custom

UAGENQFRASEXC07*CLI> module show like cdr
Module Description Use Count Status
app_cdr.so Tell Asterisk to not maintain a CDR for 0 Running
app_forkcdr.so Fork The CDR into 2 separate entities 0 Running
cdr_csv.so Comma Separated Values CDR Backend 0 Running
cdr_custom.so Customizable Comma Separated Values CDR 0 Running
cdr_manager.so Asterisk Manager Interface CDR Backend 0 Running
cdr_syslog.so Customizable syslog CDR Backend 0 Not Running
func_cdr.so Call Detail Record (CDR) dialplan functi 0 Running
7 modules loaded[/code]

As you can see, the Adaptive ODBC module is missing.

cdr_adaptive_odbc requires res_odbc which requires generic_odbc and ltdl. You’ll probably need to install unixODBC and unixODBC-dev first, then reinstall asterisk-modules and maybe asterisk itself.

Honestly, installing from source is much easier than you may think.

Download the source file (asterisk-13-current.tar.gz) to /usr/src/.
Extract the files:
$ tar zxvf asterisk-13-current.tar.gz
Change into that directory:
$ cd /usr/src/asterisk-13.5.0
Run configure:
$ ./configure
Run the menuconfig:
$ make menuconfig
Compile:
$ make
Install:
$ make install

You can also run:
$ make config
to install the startup programs
AND/OR
$ make samples
to copy sample files to /etc/asterisk/

Here are the packages I used when I installed on Ubuntu before I started installing from source…

mysql-server mysql-client unixODBC unixODBC-dev libmyodbc dahdi-firmware-nonfree asterisk asterisk-config asterisk-core-sounds-en asterisk-core-sounds-en-g722 asterisk-core-sounds-en-gsm asterisk-core-sounds-en-wav asterisk-dahdi asterisk-dbg asterisk-dev asterisk-doc asterisk-modules asterisk-moh-opsound-g722 asterisk-moh-opsound-gsm asterisk-moh-opsound-wav asterisk-mysql asterisk-voicemail-odbcstorage dahdi dahdi-dkms dahdi-linux dahdi-source

I recently wrote a document for my team to install asterisk on two failover servers.

/etc/network/interfaces
auto eth0
iface eth0 inet static
address 172.17.250.201
netmask 255.255.0.0
gateway 172.17.1.1
dns-nameserver 172.18.99.251 172.18.99.252 172.18.98.150
dns-search {ourdomain}

#Update and Install applications and dependancies
apt-get update
apt-get dist-upgrade
shutdown -r now
apt-get install keepalived ntp mysql-server mysql-client unixODBC unixODBC-dev libmyodbc php5 php5-cli php5-mysql phpmyadmin festival build-essential subversion libncurses5-dev libssl-dev libxml2-dev libsqlite3-dev uuid-dev vim-nox linux-headers-uname -r libjansson-dev libiksemel-dev libssl-dev wget libxml2-dev sox libsox-fmt-all libcurl4-openssl-dev libneon27-dev libical-dev
shutdown -r now

#Copy source code to /usr/src (core and extra sounds can be found at downloads.asterisk.org/pub/telep … /releases/)
tar zxvf libpri-1.4-current.tar.gz
tar zxvf dahdi-linux-complete-current.tar.gz
tar zxvf asterisk-13.5.0.tar.gz
#Copy sound files to /usr/src/asterisk-13.5.0/sounds because the firewall will block downloads
cp /usr/src/asterisk-core-sounds-en-* /usr/src/asterisk-13.5.0/sounds/
cp /usr/src/asterisk-extra-sounds-en-* /usr/src/asterisk-13.5.0/sounds/
cp /usr/src/asterisk-moh-opsound-* /usr/src/asterisk-13.5.0/sounds/

#Install libpri
cd /usr/src/libpri-1.4.15
make
make install

#Install dahdi
cd /usr/src/dahdi-linux-complete-2.10.2+2.10.2
make
make install
make config

#Install asterisk
cd /usr/src/asterisk-13.5.0
./configure
make menuconfig
#Change to ODBC_STORAGE under Voicemail Build Options
#Add All *EN-WAV *EN-ULAW *EN-ALAW *EN-GSM *EN-G722 files under Core Sound Packages
#Add All *EN-WAV *EN-ULAW *EN-ALAW *EN-GSM *EN-G722 files under Music On Hold File Packages
#Add All *EN-WAV *EN-ULAW *EN-ALAW *EN-GSM *EN-G722 files under Extra Sound Packages
make
make install
make config

shutdown -r now

#Copy /etc/asterisk/* from another server
scp * mkozusnik@172.17.250.202:/etc/asterisk/
#Copy /var/lib/asterisk/agi-bin/* from another server
scp * mkozusnik@172.17.250.202:/var/lib/asterisk/agi-bin/
#Copy /etc/keepalived/keepalived.conf from another server…change virtual ip in the file and make the priority lower on the second server

nano /etc/odbc.ini
[asterisk-connector]
Description = MySQL connection to ‘asterisk’ database
Driver = MySQL
Database = asterisk
Server = localhost
Port = 3306
Socket = /var/run/mysqld/mysqld.sock

nano /etc/odbcinst.ini
[MySQL]
Description = ODBC for MySQL
Driver = /usr/lib/x86_64-linux-gnu/odbc/libmyodbc.so
Setup = /usr/lib/x86_64-linux-gnu/odbc/libodbcmyS.so
FileUsage = 1

shutdown -r now

#Create database user, replication user, and asterisk database.

#Set up mysql replication
nano /etc/my/my.cnf
#Comment out bindaddr
#bindaddr 127.0.0.1

#Change server section
#Set server-id to 1 or 2 depending on which server you’re setting up.
server-id = 1
log_bin = /var/log/mysql/mysql-bin.log
log_bin_index = /var/log/mysql/mysql-bin.log.index
relay_log = /var/log/mysql/mysql-relay-bin
relay_log_index = /var/log/mysql/mysql-relay-bin.index
expire_logs_days = 10
max_binlog_size = 100M
log_slave_updates = 1
local-infile = 0
binlog-format = mixed

#Restart MySQL
/etc/init.d/mysql restart

#Once both servers are set up, set up the replication.

#2
mysql> show master status;
±-----------------±---------±-------------±-----------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
±-----------------±---------±-------------±-----------------+
| mysql-bin.000001 | 107 | | |
±-----------------±---------±-------------±-----------------+
1 row in set (0.00 sec)

#1
stop slave;
CHANGE MASTER TO MASTER_HOST = ‘172.17.250.202’, MASTER_USER = ‘replicator’, MASTER_PASSWORD = ‘--------’, MASTER_LOG_FILE = ‘mysql-bin.000001’, MASTER_LOG_POS = 107;
start slave;
show slave status\G;

#1
mysql> show master status;
±-----------------±---------±-------------±-----------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
±-----------------±---------±-------------±-----------------+
| mysql-bin.000020 | 40159 | | |
±-----------------±---------±-------------±-----------------+
1 row in set (0.00 sec)

#2
stop slave;
CHANGE MASTER TO MASTER_HOST = ‘172.17.250.201’, MASTER_USER = ‘replicator’, MASTER_PASSWORD = ‘--------’, MASTER_LOG_FILE = ‘mysql-bin.000020’, MASTER_LOG_POS = 40159;
start slave;
show slave status\G;

#Export database from another server to a sql file
#Import database to this cluster

#To allow more open files.
nano /etc/security/limits.conf
#Add
root soft nofile 40000
root hard nofile 40000

nano /etc/pam.d/common-session
#Add
session required pam_limits.so

Thank you for your answers,

How can I check my packages installed?

For information, I have the following configuration:

res_odbc_additional.conf:

[asteriskcdrdb] enabled=>yes dsn=>MySQL-asteriskcdrdb pooling=>no limit=>1 pre-connect=>yes username=>asteriskuser password=>rasp_amp

res_odbc_custom.conf:

[code][asterisk]
enabled => no
dsn => asterisk
pre-connect => yes

[mysql2]
enabled => no
dsn => MySQL-asterisk
username => myuser
password => mypass
pre-connect => yes

[sqlserver]
enabled => no
dsn => mickeysoft
share_connections => no
limit => 5
username => oscar
password => thegrouch
pre-connect => yes
sanitysql => select count(*) from systables
[/code]

cdr_adaptive_odbc.conf:

[adaptive_connection] connection=asterisk table=cdr

Look in /usr/lib/asterisk/modules/. If the .so file is there, it’s installed. I rarely use RedHat distros so, I’m not as familiar with yum. You could try "dpkg-query -l package-name". The problem is the package managers is just that. It’s harder to tell what pieces are installed. That’s why I prefer to compile from source. The “make menuselect” will allow you to pick and choose with more granularity.

Unfortunelety, I haven’t the cdr_adaptive_odbc.so module:

[asterisk@UAGENQFRASEXC07 modules]$ ls | grep cdr app_cdr.so app_forkcdr.so cdr_csv.so cdr_custom.so cdr_manager.so cdr_syslog.so func_cdr.so

So could I install unixODBC and unixODBC-dev first with yum and then have the missing package?
Even though, I didn’t reinstall Asterisk or Asterisk modules?
Or should I do this?

Thank you again.

You have to install unixODBC unixODBC-dev and compile the module using asterisk source.
Connect to cli and give the command core show version.
The asterisk version will be shown on your screen.
Donwload the tar.gz packet from the asterisk website, untar it, get in the source directory and run the commands

./configure

make menuselect

There check that the module is enabled. Save and exit.
Run make all. When finished find the compiled module and copy it to the /usr/lib/asterisk/modules/ directory. Change ownsership and privileges to the ones that all the other modules have, restart asterisk.

core show version Asterisk 12.8.1 built by root @ ibmxxxxxxx.digium.internal on a x86_64 running Linux on 2015-01-29 01:47:34 UTC

I understand what you said but I have a problem, my VM don’t have any external access.

Download tarball to your computer, download and install winscp, connect with your ssh root credentials, drop tarball in the box, follow steps of previous post.

Thank you for your answer,

But I didn’t understand the fact I have to download tarball because it combine many files into one and we want to untar it, right?
We can do this by taping tar -xvzf filename.

You said about downloading the tar.gz packet from the asterisk website but in order to reinstall Asterisk no?
Because I didn’t want to do this if possible.

Thank you again.

After you have transfered the tarball in the machine and untar it with the command tha you wrote, excuting ./configure, make menuselect and make all, will just build the module that you need and not install asterisk again.

That’s why after building the module you have to manually copy the file.

It is not a good idea to build a module on its own. Some of the menuselect options can result in the asterisk core and other modules having an incompatible API. You can do it if you have the configuration file that the packager used, and you just add modules, but that is going to be even more complex.

Building from source will not overwrite the existing configuration, so re-installing Asterisk is not that much of a risk.

Basically in this case, the OP either needs to investigate the package system to see if there is another package, from the same source, that includes the module he wants, or he needs to bite the bullet and accept that he has gone outside the scope of the package system and must either change his requirements or build from source.