Problem with cdr_odbc


#1

My Asterisk doesn’t write CDR’s to database via ODBC. Plz, anybody help
me to understand, what I am doing wrong.

Asterisk succesfully writes CDR’s into the text log.
Database exists, unixODBC installed and configured properly (I can use
database from isql, Asterisk reads sipusers from it…).

“cdr_odbc” occurances in my “full” log:

Mar 28 15:11:44 VERBOSE[8753] logger.c: [cdr_odbc.so]Mar 28 15:11:44 VERBOSE[8753] logger.c: [cdr_odbc.so] => (ODBC CDR Backend)
Mar 28 15:11:44 DEBUG[8753] config.c: Parsing /usr/local/asterisk/etc/asterisk/cdr_odbc.conf
Mar 28 15:11:44 DEBUG[8753] cdr_odbc.c: cdr_odbc: Logging uniqueid
Mar 28 15:11:44 DEBUG[8753] cdr_odbc.c: cdr_odbc: Not logging in GMT
Mar 28 15:11:44 VERBOSE[8753] logger.c: – cdr_odbc: dsn is asterisk
Mar 28 15:11:44 VERBOSE[8753] logger.c: – cdr_odbc: username is astserver
Mar 28 15:11:44 VERBOSE[8753] logger.c: – cdr_odbc: password is [secret]
Mar 28 15:11:44 VERBOSE[8753] logger.c: – cdr_odbc: table is cdr

(and that’s all!)

Asterisk’s configs:

cdr.conf

[general]
enable=yes
batch=no
safeshutdown=yes

cdr_manager.conf

[general]
enabled = no

cdr_odbc.conf

[global]
dsn=asterisk
username=astserver
password=12345
loguniqueid=yes
dispositionstring=yes
table=cdr;“cdr” is default table name
;usegmtime=no ; set to “yes” to log in GMT

res_odbc.conf

[asterisk]
enabled => yes
dsn => asterisk
username => astserver
password => 12345
pre-connect => yes

extconfig.conf

[settings]
sipusers => odbc,asterisk,sip_buddies
sippeers => odbc,asterisk,sip_buddies

modules.conf

[modules]
autoload=yes
preload => res_odbc.so
preload => res_config_odbc.so
load => cdr_odbc.so
noload => chan_iax2.so
noload => pbx_gtkconsole.so
noload => pbx_kdeconsole.so
noload => app_intercom.so
noload => chan_modem.so
noload => chan_modem_aopen.so
noload => chan_modem_bestdata.so
noload => chan_modem_i4l.so
load => res_musiconhold.so
noload => chan_alsa.so
[global]


#2

Try checking these two things.

1.) Make sure the ‘cdr’ database exists, and is setup with the proper fields.
2.) Make sure that sufficient priviliges are given to your user ‘astserver’ so that it can write records into these databases.

What database are you using? If your database supports this, have it log all of the SQL queries sent to the database. You can then see if Asterisk is sending the query, and what query it is sending.

Good Luck,
Dan


#3

Thanks, I solved this problem already (ODBC settings…).


#4

can you tell me what have you change in your ODBC setting?

Thanks