The DEVICE_STATE() function is not working as expected. For example:
Peer B is offline (no internet connection). Peer A calls Peer B. DEVICE_STATE(SIP/PeerB) returns RINGING – when UNAVAILABLE is expected.
Also if we kill PeerB process (i.e. force-stop app), DEVICE_STATE(SIP/PeerB) returns NOT_INUSE (instead of UNAVAILABLE).
Does the DEVICE_STATE() function read from a cached memory in Asterisk or does it query the state in realtime? Is there any setting we can tweak to force it to read the actual state, a refresh timeout setting maybe?