Timing issue with func DEVICE_STATE()

Hi,

Can someone acknowledge this issue? I am using asterisk 11.10.2.

If the time between setting and getting a custom device state is too short, you get wrong device states.

The following example does not work correct:

exten => s,1,NoOp(${DEVICE_STATE(Custom:p100)})
same => n,Set(DEVICE_STATE(Custom:p100)=${IF($["${DEVICE_STATE(Custom:p100)}" = “INUSE”]?NOT_INUSE:INUSE)})
same => n,NoOp(${DEVICE_STATE(Custom:p100)})

The following example does work correct:
exten => s,1,NoOp(${DEVICE_STATE(Custom:p100)})
same => n,Set(DEVICE_STATE(Custom:p100)=${IF($["${DEVICE_STATE(Custom:p100)}" = “INUSE”]?NOT_INUSE:INUSE)})
same => n,Wait(5)
same => n,NoOp(${DEVICE_STATE(Custom:p100)})

You can’t submit bug reports here, you must use issues.asterisk.org. However, I suspect it will come back as expected behaviour.