List of registered extensions from the CLI

On this system there are 24 extensions:
15 SIP
9 IAX2

How do I get a current list of registered extensions? SIP and/or IAX2.
The list should include extensions that are in use, idle, ringing, etc.
The list should exclude extensions that are “unavailable”, not registered, etc.

I want to get this list from the asterisk CLI at the console.