Issue with device_state

I’m having an issue which I hope someone can point out the problem to me.

Running Asterisk I have setup a BLF key on the phones for the queue agent login/out. So basically the button when pressed will dial a number that logs them in or out depending on their current state. The BLF is lit when logged in and off when logged out.

This all seems to work well, but I have instances were it appears that Asterisk is picking the wrong BLF to light.

On my phone since I’m testing and setting this up, I have keys for multiple queues…

Some registered hints:

-= Registered Asterisk Dial Plan Hints =- *60062855@from-sip : Custom:60062855 State:Idle Watchers 1 *60052855@from-sip : Custom:60052855 State:Idle Watchers 1 *60042855@from-sip : Custom:60042855 State:Idle Watchers 1 *60032855@from-sip : Custom:60032855 State:Idle Watchers 1 *60022855@from-sip : Custom:60022855 State:Idle Watchers 1 *60012855@from-sip : Custom:60012855 State:Idle Watchers 1 *61102855@from-sip : Custom:60102855 State:Idle Watchers 1


[code]# queue login logout
exten => _*6X01!,1,Macro(queueloginout,pos)
exten => _*6X02!,1,Macro(queueloginout,lic)
exten => _*6X03!,1,Macro(queueloginout,uw)
exten => _*6X04!,1,Macro(queueloginout,sales)
exten => _*6X05!,1,Macro(queueloginout,claims)
exten => _*6X06!,1,Macro(queueloginout,prem)
exten => _*6X10!,1,Macro(queueloginout,test)

exten => s,1,Answer
exten => s,n,NoCDR
exten => s,n,Set(xDEVNAME=60${MACRO_EXTEN:3:2}${CALLERID(num)})
exten => s,n,AddQueueMember(${ARG1},${MACRO_EXTEN:2:1})
exten => s,n,gotoif($[ ${AQMSTATUS}=MEMBERALREADY ]?logout)
exten => s,n(login),Set(DEVICE_STATE(Custom:${xDEVNAME}=INUSE)
exten => s,n,Playback(agent-loginok)
exten => s,n,Hangup
exten => s,n(logout),RemoveQueueMember(${ARG1})
exten => s,n,Set(DEVICE_STATE(Custom:${xDEVNAME}=NOT_INUSE)
exten => s,n,Playback(agent-loggedoff)
exten => s,n,Hangup

Here is the message log of an instance of the problem…

-- Executing [*61102855@from-sip:1] Macro("SIP/2855-00001398", "queueloginout,test") in new stack -- Executing [s@macro-queueloginout:1] Answer("SIP/2855-00001398", "") in new stack -- Executing [s@macro-queueloginout:2] NoCDR("SIP/2855-00001398", "") in new stack -- Executing [s@macro-queueloginout:3] Set("SIP/2855-00001398", "xDEVNAME=60102855") in new stack -- Executing [s@macro-queueloginout:4] AddQueueMember("SIP/2855-00001398", "test,,1") in new stack [2010-06-02 08:33:03] NOTICE[18414]: app_queue.c:4933 aqm_exec: Added interface 'SIP/2855' to queue 'test' -- Executing [s@macro-queueloginout:5] GotoIf("SIP/2855-00001398", "0?logout") in new stack -- Executing [s@macro-queueloginout:6] Set("SIP/2855-00001398", "DEVICE_STATE(Custom:60102855=INUSE") in new stack -- Executing [s@macro-queueloginout:7] Playback("SIP/2855-00001398", "agent-loginok") in new stack -- <SIP/2855-00001398> Playing 'agent-loginok.gsm' (language 'en') == Extension Changed *60032855[from-sip] new state InUse for Notify User 2855 -- Executing [s@macro-queueloginout:8] Hangup("SIP/2855-00001398", "") in new stack == Spawn extension (macro-queueloginout, s, 8) exited non-zero on 'SIP/2855-00001398' in macro 'queueloginout' == Spawn extension (from-sip, *61102855, 1) exited non-zero on 'SIP/2855-00001398'

You can see it said to do this:
– Executing [s@macro-queueloginout:6] Set(“SIP/2855-00001398”, “DEVICE_STATE(Custom:60102855=INUSE”) in new stack

yet this is what was changed:
== Extension Changed *60032855[from-sip] new state InUse for Notify User 2855