How does one tell which codec is active on a connection?

How does one track which codec is running on any given connection. It would be a nice addition to the reports.

You can only look at a live channel. If you are using SIP then look at the SIP channel on Asterisk info, ditto for IAX.

Remember each call has two legs, one to the telephone and one to the line (such as SIP, DAHDI or IAX).