Logging all actions/keypresses during a call?

Simply put, I want to log the keypresses a user takes while navigating a menu to find what they want during a call.

The idea being that I can make the menus more user friendly. So let’s say we have 3 menus 3 deep with an option of “*” to leave a message, let’s say they selected option 1 then option 3 then option 2 and then left a message, I just want to append to a simple plain text file something like:

I can write to files, I can set, get and append to variables. In other words, I could do this the hard way by reading and then appending to a variable and then doing a “file” write on a hangup action, but one thing I’ve learnt with Asterisk is that if I cobble something together, 30 minutes later I find a built in function that does it in one line!

However, this one has eluded me, so suggestions are welcome! Thanks.

Enable DTMF logging.

Thanks David - that seems quite logical!

However, I can’t seem to get it to do what I want.
Sure, I can log each action as a seperate to a standard file like dtmf.log, but is there any way of controlling the format and location of individual logs within the logger.conf, based on the current dialplan context?

I also know that I can write arbitrary stuff to nominated logs from the dialplan itself.

But in an idea world, for extension 6050, I’d have, for example, a separate log file called “6050_dtmf.log” containing just
15/11/2015 23:23 1,3,2,*
rather than a “combined everything” dtmf log which currently is looking like rather a lot of info for a single keypress!

[2015-11-16 11:25:13] DTMF[4155][C-00000004] channel.c: DTMF begin '2' received on PJSIP/6001-00000004 [2015-11-16 11:25:13] DTMF[4155][C-00000004] channel.c: DTMF begin ignored '2' on PJSIP/6001-00000004 [2015-11-16 11:25:13] DTMF[4155][C-00000004] channel.c: DTMF end '2' received on PJSIP/6001-00000004, duration 200 ms [2015-11-16 11:25:13] DTMF[4155][C-00000004] channel.c: DTMF end passthrough '2' on PJSIP/6001-00000004

It’s OK if there’s not a “built in” method - I can still work around it, and I’ll post what I got here later when I write it, just in case it helps anyone else!