CDR capturing default date time value for each call

Below is my environment:
Asterisk: 12.8.2
Ubuntu: 12.0.4

I have activated CDR data capture on MySQL but all call data is populating default date time value of 0000-00-00 00:00:00 in CDR table.
My server time and time zone are set correctly, please see below:
[email protected]:~# date
Fri Mar 18 11:18:47 IST 2016
However I can not check time on FreePBX GUI, as I am not getting System Admin option under Admin menu to check time and timezone. But under Time Group option I can see correct time being displayed in above right corner.
I am searching for solution on net for couple of days for this problem, but could not find any working answer.
Could anyone help me to solve this issue.

Thanks & Regards,
Piyush Aghera

Any reason you’re using Asterisk 12? 11 and 13 are the only LTS releases, and it’s not generally recommended/supported.

Thank you for the response. I was also thinking to upgrade to Asterisk 13, but wasn’t sure what can be the best way to upgrade to Asterisk 13 without affecting FreePBX which I have now upgraded to 13. Can I just install newer version of Asterisk 13 or any specific upgrade procedure i have to follow. I know this is more of an Asterisk specific question, but if you could give me some direction or at least give me direction whether installing Asterisk 13 will break anything in FreePBX.

Piyush Aghera

FreePBX fully supports asterisk 13, if you have any legacy code that is tied to asterisk < 13 , you might have problems.

Thanks Dicko. so I assume i can just go ahead and install Asterisk 13.
Thank you again.

Ok, so i have upgraded Asterisk to 13.7.2 and FreePBX to 13.0.89, but still CDR records default date time value.

Looks like something else is still missing. Please advise what else can be done here so CDR captures correct server time in the database.

| 0000-00-00 00:00:00 | “Extension1” <60001> | 60001 | 60002 | from-internal | SIP/60001-00000000 | | Dial | SIP/60002,15,TtrIb(func-apply-sipheaders^s^1) | 16 | 15 | ANSWERED | 3 | | 1458553535.0 | | | | 60001 | Extension1 | | | |
| 0000-00-00 00:00:00 | “Extension1” <60001> | 60001 | 60002 | from-internal | SIP/60001-00000001 | | Dial | SIP/60002,15,TtrIb(func-apply-sipheaders^s^1) | 6 | 6 | ANSWERED | 3 | | 1458553637.9 | | | | 60001 | Extension1 | | | |

I think i understood what is happening here post 10.x versions.
Asterisk stores 3 datetime values for each call - start, answer and end - so if i do not specify anything, i believe Asterisk is not able to understand what to store and hence storing the default value.
So i added an alias in /etc/asterisk/cdr_adaptive_odbc.conf as below, to give Asterisk a directive on which value to store in CDR:
alias start => calldate

Reloaded the module and voila!!! CDR table started recording correct date and time!!!

1 Like