Call detail records are not saving in cdr

When I make a call using softphones the call detail records are not showing in cdr?It says that cdr table is empty!Why?

Have you configure the ODBC connector to write the CDR records on the DB ?

1 Like

Actually in cdr table it shows some past call detail records,not the details of calls I am doing for the moment.So the call is not being registered in cdr table!When cdr show status is running it shows the following? Why it is happening?35%20PM

Registered Backends none

Folow this guide
http://asteriskdocs.org/en/3rd_Edition/asterisk-book-html-chunk/installing_configuring_odbc.html

I made a quick guide for ubuntu 18 server and MYSQL as CDR Backend

Hi,

Kindly Share the guide?

Thanks in advance

Ubuntu 18 Asterisk 16 CDR ODBC

Install packages
apt-get install unixodbc-dev unixodbc-bin unixodbc

/etc/odbc.ini
[asterisk-mysql]
Description = MySQL connection to β€˜asterisk’ database
Driver = MySQL
Database = asterisk
Server = localhost
UserName = root
Password = β€˜β€™
Port = 3306
Socket = /var/run/mysqld/mysqld.sock

This lib need to be downloaded from MYSQL SITE

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

/etc/asterisk/cdr_adaptive_odbc.conf

[asterisk-mysql]
connection=asterisk-mysql
table=cdr
alias start => calldate

/etc/asterisk/res_odbc.conf
[asterisk-mysql]
enabled => yes
dsn => asterisk-mysql
username => root
password => β€˜β€™
pre-connect => yes

assuming asterisk db exist create the table

CREATE TABLE cdr (
calldate datetime NULL ,
clid varchar(80) NOT NULL default β€˜β€™,
src varchar(80) NOT NULL default β€˜β€™,
dst varchar(80) NOT NULL default β€˜β€™,
dcontext varchar(80) NOT NULL default β€˜β€™,
channel varchar(80) NOT NULL default β€˜β€™,
dstchannel varchar(80) NOT NULL default β€˜β€™,
lastapp varchar(80) NOT NULL default β€˜β€™,
lastdata varchar(80) NOT NULL default β€˜β€™,
duration int(11) NOT NULL default β€˜0’,
billsec int(11) NOT NULL default β€˜0’,
disposition varchar(45) NOT NULL default β€˜β€™,
amaflags int(11) NOT NULL default β€˜0’,
accountcode varchar(20) NOT NULL default β€˜β€™,
uniqueid varchar(32) NOT NULL default β€˜β€™,
userfield varchar(255) NOT NULL default β€˜β€™
);
restart asterisk

service asterisk restart

2 Likes

Okay I did the above configuration at my files but still cdr table does not write call detail records?

You should have similar output if run these commands

Verify the DNS connection

root@vultr:~# asterisk -x " odbc show"

ODBC DSN Settings

Name: asterisk-mysql
DSN: asterisk-mysql
Number of active connections: 1 (out of 1)

ALSO the driver configuration

echo β€œselect 1” | isql -v asterisk-mysql
Β±--------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
Β±--------------------------------------+
SQL> select 1
Β±--------------------+
| 1 |
Β±--------------------+
| 1 |
Β±--------------------+
SQLRowCount returns 1
1 rows fetched

Hi @ambiorixg12 I have this issue that my CDR record is showing both start time and answer time is the same. Any idea on how i solve this?

You need to open a new thread for this issue as well post your dial plan to see if the can is answered immediately after been dialed

I have started from the link
http://asteriskdocs.org/en/3rd_Edition/asterisk-book-html-chunk/installing_configuring_odbc.html,and I have a problem at these commands:
$~/src/asterisk-complete/asterisk/1.8
$ ./configure
$ make menuselect
$ make install
I am not sure which is my β€˜source directory’ as the link says?

The source directory is the directory into which you extracted the Asterisk source files when you originally built Asterisk. If you actually used a binary package, the details will depend on how the package was constructed, and whether the packager has applied patched to the standard Asterisk code.

How to know where I have extracted the Asterisk source files?
When I go to /usr/src/ and write the command ./configure it says:
-bash: ./configure: No such file or directory

You are the only person that would know where you extracted them or even if you ever built from source.

From the fact that you are asking, I suspect you never built from source, but used a binary package. You are going to need to find out what configuration was specified when creating that binary package. If you have never built from source, you have more learning to do that can be easily put into a short forum response.

Yes I have not extracted files.AsteriskNOW is installed in a machine.