Can't load cdr_adaptive_odbc.so module

Hello All,

I’m trying to configure odbc with Asterisk 1.8 for postgres. I have select all cdr application in the make menuselect but l’m having problem with the following. Any help would be highly appreciable

ws1CLI> module reload cdr_adaptive_odbc.so
No such module 'cdr_adaptive_odbc.so’
ws1
CLI> module load cdr_adaptive_odbc.so
Unable to load module cdr_adaptive_odbc.so
Command ‘module load cdr_adaptive_odbc.so’ failed.
[Dec 31 03:10:00] WARNING[21604]: loader.c:396 load_dynamic_module: Error loading module ‘cdr_adaptive_odbc.so’: /usr/lib/asterisk/modules/cdr_adaptive_odbc.so: cannot open shared object file: No such file or directory
[Dec 31 03:10:00] WARNING[21604]: loader.c:848 load_resource: Module ‘cdr_adaptive_odbc.so’ could not be loaded.
ws1*CLI>

ws1*CLI> cdr show status

Call Detail Record (CDR) settings

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

  • Registered Backends

    csv
    cdr_sqlite3_custom
    pgsql
    cdr-custom

== Just FYI… here is the all conf files I have configured to enable adaptive_odbc

cat /etc/odbcinst.ini

Example driver definitions

Driver from the postgresql-odbc package

Setup from the unixODBC package

[PostgreSQL]
Description = ODBC for PostgreSQL
Driver = /usr/local/lib/psqlodbcw.so
Setup = /usr/lib/libodbcpsqlS.so
Driver64 = /usr/lib64/psqlodbc.so
Setup64 = /usr/lib64/libodbcpsqlS.so
FileUsage = 1


at /etc/odbc.ini
[ast-pgsql-odbc]
Description = PostgreSQL connection to ‘asterisk’ database
Driver = PostgreSQL
Database = apcc
Servername = localhost
UserName = ast
Password = ast
Port = 5432
Protocol = 7.4
ReadOnly = No
RowVersioning = No
ShowSystemTables = No
ShowOidColumn = No
FakeOidIndex = No
ConnSettings =


odbcinst -q -d

[PostgreSQL]
[MySQL]


[root@ws1 ~]# echo “select 1” | isql -v ast-pgsql-odbc
±--------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
±--------------------------------------+
SQL> select 1
±-----------+
| ?column? |
±-----------+
| 1 |
±-----------+
SQLRowCount returns 1
1 rows fetched

/u01/asterisk_src/asterisk
./configure

make menuselect

make install

—output…

[CC] format_wav.c -> format_wav.o
[LD] format_wav.o -> format_wav.so
[CC] format_wav_gsm.c -> format_wav_gsm.o
[LD] format_wav_gsm.o -> format_wav_gsm.so
[CC] cdr_adaptive_odbc.c -> cdr_adaptive_odbc.o
[EMBED] cdr_adaptive_odbc.o -> cdr_adaptive_odbc.eo
[CC] cdr_csv.c -> cdr_csv.o
[EMBED] cdr_csv.o -> cdr_csv.eo
[CC] cdr_custom.c -> cdr_custom.o
[EMBED] cdr_custom.o -> cdr_custom.eo

[LD] res_config_curl.o -> res_config_curl.so
[CC] res_config_ldap.c -> res_config_ldap.o
[LD] res_config_ldap.o -> res_config_ldap.so
[CC] res_config_odbc.c -> res_config_odbc.o
[LD] res_config_odbc.o -> res_config_odbc.so
[CC] res_config_pgsql.c -> res_config_pgsql.o
[LD] res_config_pgsql.o -> res_config_pgsql.so

[CC] res_odbc.c -> res_odbc.o
[LD] res_odbc.o -> res_odbc.so

cat /etc/asterisk/res_odbc.conf
[astpg]
enabled => yes
dsn => ast-pgsql-odbc
username => ast
password => ast
pooling => no
limit => 0
pre-connect => yes

ws1CLI> odbc show
No such command ‘odbc show’ (type ‘core show help odbc show’ for other possible commands)
ws1
CLI>

============

ws1*CLI> cdr show status

Call Detail Record (CDR) settings

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

  • Registered Backends

    csv
    cdr_sqlite3_custom
    pgsql
    cdr-custom

=====
ws1CLI> module reload cdr_adaptive_odbc.so
No such module 'cdr_adaptive_odbc.so’
ws1
CLI>

===
ws1CLI> module load cdr_adaptive_odbc.so
Unable to load module cdr_adaptive_odbc.so
Command ‘module load cdr_adaptive_odbc.so’ failed.
[Dec 31 03:56:29] WARNING[3910]: loader.c:396 load_dynamic_module: Error loading module ‘cdr_adaptive_odbc.so’: /usr/lib/asterisk/modules/cdr_adaptive_odbc.so: cannot open shared object file: No such file or directory
[Dec 31 03:56:29] WARNING[3910]: loader.c:848 load_resource: Module ‘cdr_adaptive_odbc.so’ could not be loaded.
ws1
CLI>

It’s embedded, so you cannot load it independently. Try reloading the host module.

thanks for your reply. i didn’t find any module call host,

ws1*CLI> module show like host
Module Description Use Count
0 modules loaded

JST FYI…

ws1*CLI> MODULE SHOW LIKE CDR
Module Description Use Count
app_cdr.so Tell Asterisk to not maintain a CDR for 0
app_forkcdr.so Fork The CDR into 2 separate entities 0
cdr_csv.so Comma Separated Values CDR Backend 0
cdr_custom.so Customizable Comma Separated Values CDR 0
cdr_manager.so Asterisk Manager Interface CDR Backend 0
cdr_pgsql.so PostgreSQL CDR Backend 0
cdr_sqlite3_custom.so SQLite3 Custom CDR Module 0
cdr_syslog.so Customizable syslog CDR Backend 0
func_cdr.so Call Detail Record (CDR) dialplan functi 0
9 modules loaded

“host” was an adjective, meaning, in this case, the module in which the “module” you want is embedded.

solved the problem. here what i did.

  1. uninstall Asterisk (stop asterisk => remove all directories)

  2. Confirm ODBC & Database is available (in my case, i’m using postgresql)

  3. Install Asterisk.

I was able to store cdr database via odbc with custom fields.

Thanks all of you for help.