sip show peers will only show ChanSIP endpoints. If you want to get ChanSIP and PJSIP with one query, you can do it with ARI:
https://wiki.asterisk.org/wiki/display/AST/Asterisk+18+Endpoints+REST+API
See this post for an example. Note, you can also pass the credentials like this:
GET /ari/channels?api_key=username:password
You can also do it with AMI.
PJSIP:
https://wiki.asterisk.org/wiki/display/AST/Asterisk+18+ManagerAction_PJSIPShowEndpoints
ChanSIP:
https://wiki.asterisk.org/wiki/display/AST/Asterisk+18+ManagerAction_SIPpeers
Another good resource: @sorvani put this together, I believe this only works with PJSIP. https://github.com/sorvani/freepbx-helper-scripts/tree/master/Extension_Status