# DEVICE\_STATE function is not working

**URL:** <https://community.asterisk.org/t/device-state-function-is-not-working/37276>\
**Category:** Asterisk Support\
**Created:** [November 4, 2011, 4:35pm UTC](https://community.asterisk.org/t/device-state-function-is-not-working/37276 "2011-11-04T16:35:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/asterisk/original/2X/4/475d0c889911cfb84ac4881ad6df8b523e3f9105.png) [@system](https://community.asterisk.org/u/system)\
**Post date:** [November 4, 2011, 4:35pm UTC](https://community.asterisk.org/t/device-state-function-is-not-working/37276/1 "2011-11-04T16:35:03Z")

</div>

Hi ,  
I used the DEVICE\_STATE function in asterisk dial plan to get the status of device . but it doesn’t work for me . I am always getting status NOT\_INUSE . Please kindly tell me , is there any other configuration for this .

The Dialplan i :

exten =\> 888,1,answer  
exten =\> 888,n,Verbose(3,The state of SIP/100 is ${DEVICE\_STATE(SIP/100)}))  
exten =\> 888,n,Hangup

I called from SIP/100 extension to 888 . the call has been answered . but in the asterisk console , i am getting as  
"The state of SIP/100 is NOT\_INUSE

---

<div class="post-metadata">

**Author:** ![david55](https://avatars.discourse-cdn.com/v4/letter/d/e19adc/32.png) [@david55](https://community.asterisk.org/u/david55)\
**Post date:** [November 4, 2011, 4:38pm UTC](https://community.asterisk.org/t/device-state-function-is-not-working/37276/2 "2011-11-04T16:38:08Z")

</div>

You need a connection limit defining. The original way of doing this is deprecated and I’m not sure of the replacement. I think you may need to use a different method to detect in use.
