How to determine whether the agent has entered correct queue

Dear All,

I have 3 queues (1, 2 and 3) … for agent login, the agent should press *50 then followed by their queue name (ie. *501) and for agent logoff they should press *51 then followed with the queue name (ie. *511)
and the agent should enter their VM password… if they passed then they would be able to do login or logoff…

my question is: how to determine whether the agent has entered correct queue no?

please help

Thanks & regards

;for agent logoff

exten => _*50x,1,answer
exten => _*50x,n,VMAuthenticate(${CALLERID(NUM)})
exten => _*50x,n,RemoveQueueMember(${EXTEN:3})
exten => _*50x,n,Playback(agent-loggedoff)
exten => _*50x,n,Hangup

;for agent login

exten => _*51x,1,answer
exten => _*51x,n,VMAuthenticate(${CALLERID(NUM)})
exten => _*51x,n,AddQueueMember(${EXTEN:3})
exten => _*51x,n,Playback(agent-loginok)
exten => _*51x,n,Hangup

You would need a way to tell Asterisk what the ‘correct’ queue is, either entries in the ASTDB or external DB. then check within the dialplan.

However, maybe you should consider defining what queue(s) an agent is allowed to join and either ask the user or add them to each queue automatically after they have authenticated.

is it possible to get RemoveQueueMember(${EXTEN:3}) value …then do some actions regarding to the value?..
I am trying the following … but it doesnot work…

exten => _*10x,1,Answer
exten => _*10x,2,RemoveQueueMember(${EXTEN:3})
exten => n,GotoIf($[${RQMSTATUS} = REMOVED]?agent_removed:queue_not_found)

exten => agent_removed,1,Playback(agent-loggedoff)
exten => Hangup

exten => queue_not_found,1,Playback(vm-goodbye)
exten => Hangup

Perhaps you need to remove the spaces around the = or quote your variables and text
Also, check the syntax of the GotoIf line, it is not valid.

This line works for me…

if that does not work, what is the value of RQMSTATUS?
Add a NoOp(${RQMSTATUS}) line after the RemoveQueueMember() call

Ok, I got the value of RQMSTATUS and now I improve the codes to be as below, could you please help?
Thank you so much


context conditional {
same => {
switch (${RQMSTATUS})
     case REMOVED:
     case NOTINQUEUE:
same => n,Hangup()

Help with what? Basic dialplan syntax?
Your earlier sample was, based on what I understand you are trying to do, pretty close to working, just some syntax problems with the GotoIf line. I am not sure what your last code sample was. Pseudo-code?

I really think you need to spend some time to get an understanding of the dialplan syntax, there are plenty of examples around.

If all you are doing is playing a different message based on RQMSTATUS, then that can be accomplished with a series of GotoIf() and Goto() statements. The switch command in standard Asterisk dialplan does not do what your sample is attempting to demonstrate.

Noted and Thanks, I have done it by using GotoIf …