Call details were not save into database

Hello
I have postgresql installed in the same box of asterisk and I am trying to configure that call detail can be saved in the database. But the call details are not saved in the database. Here is the configuration:

1): from unixODBC, by using using select, it shows that unixODBC can access the database:
$ echo “select 1” | isql - asterisk-connector
2): after configure res_odbc.conf and make menuselect, etc, asterisk can see the odbc
*CLI> odbc show correct and Connected: Yes
3): I create a table in the database: call_detail and configured cdr_odbc, dsn=asterisk-connector, etc (basic info is the same as res_odbc). AND the table name is “call_detail” which is the same as the table name created.
4): *CLI>cdr status shows:
CDR logging: enabled

CDR registered backend: ODBC.

5): Test: a java code originates a call by connecting to manager, to a xten-xlite ip phone, the call is answered. Then no record is inserted into the table. At the same time, the call-detail information IS in csv file.

what is wrong?
Thanks a looooooot!

Any one can help?
Please!!!
Thanks!

Hi
When call is at hangup state You should see a log in Asterisk CLI if there is en error while saving cdr entry
(and postgresql logs events too.)

I assume that anything logged into the CVS file should be inserted to the database too. is it correct?

where is Asterisk error log, which I could find what is the error?

Thanks!
Ben

[quote=“benzhang”]I assume that anything logged into the CVS file should be inserted to the database too. is it correct?

where is Asterisk error log, which I could find what is the error?

Thanks!
Ben[/quote]

If connection to database is set correctly, then cvs entires = db entries.
#asterisk -r
CLI>core set verbose 10
make a call and watch

fdragowski,

I set the debug on, it shows error: cdr_odbc.c:133 odbc log: Unable to retrieve database handle
It is configuration in the res_odbc.conf which it was copied based on the future phone book page 273.

dsn=asterisk NOT dsn=asterisk-connector.

issues.asterisk.org/view.php?id=15021

Thanks a loooooooooooooot!

[quote=“benzhang”]It is configuration in the res_odbc.conf which it was copied based on the future phone book page 273.
dsn=asterisk NOT dsn=asterisk-connector.
[/quote]
typo: res_odbc.config should be cdr_odbc.conf