AGI Command to check SIP Registration

Is there any AGI command that would check whether a particular extension/phone is registered or not.

For e.g. on the CLI you can do “sip show registry” or even “sip show peers”

How to check it via the AGI ?

On the FreePBX, it tells how many phones are online. I’d like to have a similar functionality where it tells whether a particular extension is online or not.