[asterisk-dev] devicestate

Clod Patry cpatry at gmail.com
Tue Jan 15 17:47:42 CST 2008

Im taking a look at func_devstate.c and i see that I can only set Custom
Here's the problem:

    -- Executing [5145554188 at incomingUnlimitel:1] NoOp("IAX2/5145554188-10",
"SIP/1004 has state NOT_INUSE") in new stack
    -- Executing [5145554188 at incomingUnlimitel:2] Set("IAX2/5145554188-10",
"DEVSTATE(SIP/1004)=BUSY") in new stack
[Jan 15 18:39:19] WARNING[17840]: func_devstate.c:120 devstate_write: The
DEVSTATE function can only be used to set 'Custom:' device state!
    -- Executing [5145554188 at incomingUnlimitel:3] NoOp("IAX2/5145554188-10",
"SIP/1004 has now NOT_INUSE") in new stack

what about if you want to change current state (mainly from BUSY to

So I've take a look at:
func_devstate.c::devstate_write() to just comment the block checking for
Custom, but i simply got:

    -- Executing [5145554188 at incomingUnlimitel:1] NoOp("IAX2/5145554188-1",
"SIP/1004 has state NOT_INUSE") in new stack
    -- Executing [5145554188 at incomingUnlimitel:2] Set("IAX2/5145554188-1",
"DEVSTATE(SIP/1004)=BUSY") in new stack
    -- Executing [5145554188 at incomingUnlimitel:3] NoOp("IAX2/5145554188-1",
"SIP/1004 has now NOT_INUSE") in new stack

So it's like the devstate has not be successfully set and I'd like to know

I realized Custom devstate are written to astDB, and after it's calling
__ast_device_state_changed_literal(), and there, its should change the
state, no?

After a quick discussion with Russell on IRC, he told me the answers is
pretty long why we can explicitly change a device state.

So let's start a discussion around this :)

Clod Patry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20080115/202173b6/attachment.htm 

More information about the asterisk-dev mailing list