How to Manually generate CDR through Asterisk Dialplan without using cdr_adaptive_odbc.conf?

Hi , I want to extract call duration , recording path of of calls , generate blob file and insert these values in my custom cdr table in my database.
I know how to get callerid, dialed extension , query database, fetch results and insert them into database from asterisk dialplan
but i could not find a way to get the call duration and create a blob link in my database for the recorded call which is stored in var/lib/asterisk/monitor .

@jcolp @johnkiniston @ambiorixg12

When you store the crd’s in a mysql table, the fields duration and billsec are already there.
You also have a field userfield that you could use to store the link to your file in the /var/lib/asterisk/monitor folder.

Take a look at: https://wiki.asterisk.org/wiki/display/AST/MySQL+CDR+Backend

Sorry, the link I added was for Asterisk 1.8…

Here a link to a nice write up:
https://www.mikeslab.net/asterisk/linux/2015/01/19/ubuntu-14-04asterisk-13-cdr-reporting-to-mysql.html

2 Likes

Thanks. That was very helpful.

as was said before use ${CDR(billsec) variable and CHANNEL function to write the value on custom cdr field or accountcode, or userfield

1 Like