DEVICE_STATE function is not working

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

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.