Extension state is the state of an Asterisk extension, as opposed to the direct state of a device or a user. It is the aggregate of Device state from devices mapped to the extension through a hint directive. See the States and Presence section for a diagram showing the relationship of all the various states.
SIP Subscription to Asterisk hints
Once a hint is configured, Asterisk's SIP drivers can be configured to allow SIP User Agents to subscribe to the hints. A subscription will result in state change notifications being sent to the subscriber.
Configuration for chan_sip is discussed in Configuring chan_sip for Presence Subscriptions
Configuration for res_pjsip is discussed in Configuring res_pjsip for Presence Subscriptions