Queue restrict

Hi, I’m running small asterisk with ten dynamic agents that are logging in queue 3333. When user dials 3333*# the system prompt the user to enter his number “Agent login. Please enter your agent number followed by the pound key.” If the user don’t enter his number the system recognise his extension number and automatically log him with his extension. The problem is when the user dials number different from his extension (ex: 123123") the system logs number 123123 in the queue witch is unacceptable. How can I restrict the user to enter only his extension or when he dials 3333*# to log him with his extension directly without prompting him to enter anything ? (Or how can I define allowed users in the queue and the other who are not defined -> /dev/null :smile:

Thanks in advice !
Emil Kotsev

Verify the caller ID in the dialplan (explicitly or using the / notation in the match pattern, then lookup the agent number from the caller ID and explicitly pass it to AgentLogin.

That can be done with dialplan patterns. Can you give us the current extensions.conf?

Yes but it’s not pure asterisk … it’s astercc and the extensions.conf is huge … here is the user range I need to be logged in queue 3333: 610-619

P.S. dynamically logged in the queue.

exten => 610,1,Macro(exten-vm,novm,610)
exten => 610,n,Goto(${IVR_CONTEXT},return,1)
exten => 610,n,Goto(from-internal,610,1)
exten => 610,hint,SIP/610
exten => 611,1,Macro(exten-vm,novm,611)
exten => 611,n,Goto(${IVR_CONTEXT},return,1)
exten => 611,n,Goto(from-internal,611,1)
exten => 611,hint,SIP/611
exten => 612,1,Macro(exten-vm,novm,612)
exten => 612,n,Goto(${IVR_CONTEXT},return,1)
exten => 612,n,Goto(from-internal,612,1)
exten => 612,hint,SIP/612
exten => 613,1,Macro(exten-vm,novm,613)
exten => 613,n,Goto(${IVR_CONTEXT},return,1)
exten => 613,n,Goto(from-internal,613,1)
exten => 613,hint,SIP/613
exten => 614,1,Macro(exten-vm,novm,614)
exten => 614,n,Goto(${IVR_CONTEXT},return,1)
exten => 614,n,Goto(from-internal,614,1)
exten => 614,hint,SIP/614
exten => 615,1,Macro(exten-vm,novm,615)
exten => 615,n,Goto(${IVR_CONTEXT},return,1)
exten => 615,n,Goto(from-internal,615,1)
exten => 615,hint,SIP/615
exten => 616,1,Macro(exten-vm,novm,616)
exten => 616,n,Goto(${IVR_CONTEXT},return,1)
exten => 616,n,Goto(from-internal,616,1)
exten => 616,hint,SIP/616
exten => 617,1,Macro(exten-vm,novm,617)
exten => 617,n,Goto(${IVR_CONTEXT},return,1)
exten => 617,n,Goto(from-internal,617,1)
exten => 617,hint,SIP/617
exten => 618,1,Macro(exten-vm,novm,618)
exten => 618,n,Goto(${IVR_CONTEXT},return,1)
exten => 618,n,Goto(from-internal,618,1)
exten => 618,hint,SIP/618
exten => 619,1,Macro(exten-vm,novm,619)
exten => 619,n,Goto(${IVR_CONTEXT},return,1)
exten => 619,n,Goto(from-internal,619,1)
exten => 619,hint,SIP/619

He wanted the dialplan that imlements AgentLogin!

exten => 3333,1,Macro(user-callerid,)
exten => 3333,n,Answer
exten => 3333,n,Set(__BLKVM_OVERRIDE=BLKVM/${EXTEN}/${CHANNEL})
exten => 3333,n,Set(__BLKVM_BASE=${EXTEN})
exten => 3333,n,Set(DB(${BLKVM_OVERRIDE})=TRUE)
exten => 3333,n,ExecIf($["${REGEX("(M[(]auto-blkvm[)])" ${DIAL_OPTIONS})}" != “1”],Set,_DIAL_OPTIONS=${DIAL_OPTIONS}M(auto-blkvm))
exten => 3333,n,Set(__NODEST=${EXTEN})
exten => 3333,n,GotoIf($[“foo${RGPREFIX}” = “foo”]?REPCID)
exten => 3333,n,GotoIf($["${RGPREFIX}" != “${CALLERID(name):0:${LEN(${RGPREFIX})}}”]?REPCID)
exten => 3333,n,Noop(Current RGPREFIX is ${RGPREFIX}…stripping from Caller ID)
exten => 3333,n,Set(CALLERID(name)=${CALLERID(name):${LEN(${RGPREFIX})}})
exten => 3333,n,Set(_RGPREFIX=)
exten => 3333,n(REPCID),Noop(CALLERID(name) is ${CALLERID(name)})
exten => 3333,n,Set(_RGPREFIX=backoffice)
exten => 3333,n,Set(CALLERID(name)=${RGPREFIX}${CALLERID(name)})
exten => 3333,n,Set(MONITOR_FILENAME=/var/spool/asterisk/monitor/q${EXTEN}-${STRFTIME(${EPOCH},%Y%m%d-%H%M%S)}-${UNIQUEID})
exten => 3333,n,Queue(3333,tr,)
exten => 3333,n,dbDel(${BLKVM_OVERRIDE})
exten => 3333,n,Set(__NODEST=)
exten => 3333,n,Goto()
exten => 3333*,1,Macro(agent-add,3333,)
exten => 3333**,1,Macro(agent-del,3333,3333)

And the macros!

based on what you stated…if they enter an extension it uses that…otherwise it uses the extensions they calling from.

This indicates that the code is already there…you just need to make a change to it. Removing the ability for them to enter anything. Or implement your own login/logout.

Here is mine for what it is worth. It works as a toggle. You dial the same number to log in or logout.

exten => *6001,1,Macro(queueloginout,pos)

exten => s,1,Answer
exten => s,n,NoCDR
exten => s,n,AddQueueMember(${ARG1})
exten => s,n,gotoif($[ ${AQMSTATUS}=MEMBERALREADY ]?logout)
exten => s,n(login),NoOp()
exten => s,n,Playback(agent-loginok)
exten => s,n,Hangup
exten => s,n(logout),RemoveQueueMember(${ARG1})
exten => s,n,Playback(agent-loggedoff)
exten => s,n,Hangup

The thing I like about this, is that any phone in the company can be used to handle calls. Just sit down and dial the login extension.