Manipulating DEVICE_STATE from AMI/CLI

Hello!

I’m facing a bit strange issue, maybe doing something wrong.
I’m manipulating hints via DEVICE_STATE function. like AMI Setvar or CLI dialplan set global commands.
So, I’m able to set any state unless Idle for Custom:
Idea is I have smth like

core show hints

    -= Registered Asterisk Dial Plan Hints =-
5555_1_agent@agent_: Custom:5555_1_agent  State:Busy            Presence:not_set         Watchers  0
4444_1_agent@agent_: Custom:4444_1_agent  State:Idle            Presence:not_set         Watchers  0

Than I’m running CLI command

dialplan set global DEVICE_STATE(Custom:4444_1_agent) BUSY

   -- Global variable 'DEVICE_STATE(Custom:4444_1_agent)' set to 'BUSY'

and output is changing to

core show hints

    -= Registered Asterisk Dial Plan Hints =-
5555_1_agent@agent_: Custom:5555_1_agent  State:Busy            Presence:not_set         Watchers  0
4444_1_agent@agent_: Custom:4444_1_agent  State:Busy            Presence:not_set         Watchers  0

But when I’m running

dialplan set global DEVICE_STATE(Custom:4444_1_agent) NOT_INUSE

   -- Global variable 'DEVICE_STATE(Custom:4444_1_agent)' set to 'NOT_INUSE'

picture stays the same:

core show hints

    -= Registered Asterisk Dial Plan Hints =-
5555_1_agent@agent_: Custom:5555_1_agent  State:Busy            Presence:not_set         Watchers  0
4444_1_agent@agent_: Custom:4444_1_agent  State:Busy            Presence:not_set         Watchers  0

Means state is not reverted back to Idle
It’s no matter if I do it via CLI or AMI. If it’s done via Dialplan, it’s all work as expected.

Asterisk 18.19.0

Just fund, that all work is expected if I have Watchers >= 1 on this hint. Is it something expected or looks like a bug?

If you use the “devstate change” CLI command do things change? If you use “devstate list” is the correct state presented?

Johua,

Yes, with devstate version it works as expected. So, I assume problem with showing states in core show hints as I see inconsistency on outputs of these 2.

Many thanks!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.