CDR odbc not logging issues

I’m having a issue with CDR logging I think the CSV file logging is correct but it is miss some dates.

I’m logging to the csv file and to a odbc db.

I can log in vi isql to my odbc source

I do have data but the Time, fields are all 0000’s and the dnid field is blank

In cdr_odbc.conf

[global]
table=cdr
dsn => cdr
enable => yes
newcdrcolumns=yes
loguniqueid=yes
;hrtime=no
usegmtime=no
dispositionstring=yes

in cdr.conf

[csv]
usegmtime=yes ; log date/time in GMT. Default is “no”
loguniqueid=yes ; log uniqueid. Default is “no”
loguserfield=yes ; log user field. Default is “no”
accountlogs=yes ; create separate log file for each account code. Default is “yes”
;newcdrcolumns=yes ; Enable logging of post-1.8 CDR columns (peeraccount, linkedid, sequence).
; Default is “no”.

;[radius]
;usegmtime=yes ; log date/time in GMT
;loguniqueid=yes ; log uniqueid
;loguserfield=yes ; log user field
; Set this to the location of the radiusclient-ng configuration file
; The default is /etc/radiusclient-ng/radiusclient.conf
;radiuscfg => /usr/local/etc/radiusclient-ng/radiusclient.conf

[odbc]
usegmtime=no ; log date/time in GMT. Default is “no”
loguniqueid=yes ; log uniqueid. Default is “no”
loguserfield=yes ; log user field. Default is “no”
accountlogs=yes ; create separate log file for each account code. Default is “yes”
newcdrcolumns=yes ; Enable logging of post-1.8 CDR columns (peeraccount, linkedid, sequence).
; Default is “no”.

if I do an odbc show all I see the connections
asterisk -rx “odbc show all”

ODBC DSN Settings

Name: configuration
DSN: asterisk.configuration
Number of active connections: 1 (out of 1)
Logging: Disabled

Name: voicemail
DSN: asterisk.voicemail
Number of active connections: 1 (out of 1)
Logging: Disabled

Name: cdr
DSN: asterisk.log
Number of active connections: 1 (out of 1)
Logging: Disabled

Name: cel
DSN: asterisk.log
Number of active connections: 1 (out of 1)
Logging: Disabled

Name: logging
DSN: asterisk.log
Number of active connections: 1 (out of 1)
Logging: Disabled

Lost as to why i’m not logging everything I should be.

With cdr set debug on
I have what I think are normal messages

0x7f22f0272e30 - Processing bridge enter for SIP/opmgw23-00007a9f
0x7f22f0272e30 - Transitioning CDR for SIP/opmgw23-00007a9f from state Single to Bridged
– Channel SIP/Kathryn-Dodson-00007a9e joined ‘simple_bridge’ basic-bridge
Bridge Enter message for channel SIP/user-00007a9e: 1572530931.00062069
0x7f22f05d73b0 - Updating Party A SIP/user-00007a9e snapshot
0x7f22f05d73b0 - Processing bridge enter for SIP/user-00007a9e
0x7f22f05d73b0 - Transitioning CDR for SIP/user-00007a9e from state DialedPending to Dial
0x7f22f05d73b0 - Transitioning CDR for SIP/user-00007a9e from state Dial to Bridged

I turned Loggin on the odbc conf

I do show this

Name: cdr
DSN: asterisk.log
Number of active connections: 1 (out of 1)
Logging: Enabled
Number of prepares executed: 0
Number of queries executed: 2
Longest running SQL query: INSERT INTO cdr (calldate,clid,src,dst,dcontext,channel,dstchannel,lastapp,lastdata,duration,billsec,disposition,amaflags,accountcode,uniqueid,userfield,peeraccount,linkedid,sequence) VALUES ({ts ‘2019-10-31 09:04:50’},?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) (8 milliseconds)

as one thing being logged

but I have different columns

like start, answer, end, in my schema, I do have calldate but was expecting more data.

If I configure the cdr_adaptive_odbc up I think that fixes the missing part,

Still have the blank records but those are likely coming from cdr_odbc which I can’t get to unload

842]: cdr.c:2974 ast_cdr_generic_unregister: Unable to unregister CDR backend ODBC; 50 CDRs are still active
[2019-10-31 09:34:05.013] WARNING[123842]: loader.c:1264 ast_unload_resource: Firm unload failed for cdr_odbc.so

You will need to map your columns if they are not the ones that Asterisk expects.

I believe they are what is expected.

I unload cdr_odbc and now its correct. so I’ll have to add that to my noload list.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.