Queue toggle function

So we have a set of queues and various people are in each queue. We're using the "Queue Toggle" function to log people into/out of all their queues but have noticed a large delay when running the function. Looking at the code: [app-all-queue-toggle] include => app-all-queue-toggle-custom exten => s,1(start),Answer exten => s,n,Wait(1) exten => s,n,Macro(user-callerid,) exten => s,n,AGI(queue_devstate.agi,getall,${AMPUSER}) exten => s,n,GotoIf($["${QUEUESTAT}" = "NOQUEUES"]?skip) exten => s,n,Set(TOGGLE_MACRO=${IF($["${QUEUESTAT}"="LOGGEDOUT"]?toggle-add-agent:toggle-del-agent)}) exten => s,n,Set(LOOPCNTALL=${FIELDQTY(USERQUEUES,-)}) exten => s,n,Set(ITERALL=1) exten => s,n(begin),Set(QUEUENO=${CUT(USERQUEUES,-,${ITERALL})}) exten => s,n,Set(ITERALL=$[${ITERALL}+1]) exten => s,n,Macro(${TOGGLE_MACRO},) exten => s,n,GotoIf($[${ITERALL} <= ${LOOPCNTALL}]?begin) exten => s,n(skip),ExecIf($["${QUEUESTAT}"="LOGGEDIN" | "${QUEUESTAT}"="NOQUEUES"]?Playback(agent-loggedoff)) exten => s,n,ExecIf($["${QUEUESTAT}"="LOGGEDOUT"]?Playback(agent-loginok)) exten => s,n,ExecIf($["${QUEUESTAT}"="LOGGEDOUT"]?SayDigits(${AMPUSER})) exten => s,n,Macro(hangupcall,) ;--== end of [app-all-queue-toggle] ==--;

this appears to call toggle-add-agent many times in a loop, which is fine, however toggle-add-agent has a wait at the beginning:

[macro-toggle-add-agent] include => macro-toggle-add-agent-custom exten => s,1,Wait(1) exten => s,n,Macro(user-callerid,SKIPTTL,) exten => s,n,Set(CALLBACKNUM=${AMPUSER}) exten => s,n,GotoIf($["${DB(QPENALTY/${QUEUENO}/dynmemberonly)}" = "yes" & ${DB_EXISTS(QPENALTY/${QUEUENO}/agents/${CALLBACKNUM})} != 1]?invalid) exten => s,n,ExecIf($["${DB(AMPUSER/${CALLBACKNUM}/queues/qnostate)}" != "ignorestate"]?AddQueueMember(${QUEUENO},Local/${CALLBACKNUM}@from-queue/n,${DB(QPENALTY/${QUEUENO}/agents/${CALLBACKNUM})},,${DB(AMPUSER/${CALLBACKNUM}/cidname)},hint:${CALLBACKNUM}@ext-local)) exten => s,n,ExecIf($["${DB(AMPUSER/${CALLBACKNUM}/queues/qnostate)}" = "ignorestate"]?AddQueueMember(${QUEUENO},Local/${CALLBACKNUM}@from-queue/n,${DB(QPENALTY/${QUEUENO}/agents/${CALLBACKNUM})},,${DB(AMPUSER/${CALLBACKNUM}/cidname)})) exten => s,n,UserEvent(AgentLogin,Agent: ${CALLBACKNUM}) exten => s,n,QueueLog(${QUEUENO},MANAGER,${AMPUSERCIDNAME},ADDMEMBER,) exten => s,n,MacroExit() exten => s,n(invalid),Playback(pbx-invalid) exten => s,n,Set(QAGENT_UNAUTHORIZED=1) exten => s,n,MacroExit()

That means each iteration round the loop, causes the system to wait for 1 second, and because there is upto 10 queues, this means the operatator can be sat there listening to silence for 10 seconds while it does its thing…
I’d like to remove this wait, but ofcourse that toggle-add-agent macro is generated by FreePBX automatically…

Any ideas how i can remove it?

Thanks Kevin

hi,

copy the whole block to
/etc/asterisk/extensions_override_freepbx.conf
and edit it there :slight_smile:

Perfect thanks, that sorted it!