Asterisk CDR and MySQL

I have been given batch of asterisk machines to babysit and am stumped on the CDR. The machine at issue is running Asterisk 1.4.0 with the MySQL addon installed for CDR logging, this is working correctly (sort of). I have not restarted Asterisk because it is a production system but have used the reload command trying to reload the cdr_mysql.conf file to update the configuration. My change was to add the line userfield=1 . I need to log out and track when we get to a specific state in the dialplan and this seems like the best way to do it. After Set(CDR(userfield) = xyz ) I have Noop(${CDR(userfield)}). Within the CLI, I see xyz echoed out to the screen correctly. The problem is xyz is never actually included in the CDR recorded in userfield of the MySQL table. The available documentation on reload doesn’t indicate issues reloading anything except Zaptel configurations. Does this change strictly require a reboot or am I not fully configuring something?


Hi, I am having the same problem. Could you find a solution?

Have you check if you have this line in your cdr.conf

Also in cdr_mysql.conf:

And in extensions.conf:

The above works for me.

But I do have another problem: I want record more info into cdr and I made another custom field in the cdr table. I couldn’t make asterisk write in to that field.

Any help? Please.