Howto: Dynamic Agents login/logout + Auto loggoff
Picture the situation: a rep walks in to the office, pickups up the
phone and loges in. They are automatically logged in to their relevant queue.
After ten minutes of inactivity they are automatically logged out. Of course
the ten minutes is measured from the last activity they did (not form the initial
log in).
Advantages:
*Less pressure on the queue as only available agents are in the
queue (as apposed to every phone in the call center)
*Ability to track agents active availability, and perhaps only pay
them for the time that they where actually logged in
*Improved customer service by auto send callers to voice-mail if
there are no agent in the queue (no point in keeping them on hold if there is
no one available to answer the call anyway)
*Additional security by not allowing anyone to place a call without logging in first (yet not driving your agents crazy by requiring them to dial a code before every call)
------code and instructions here-----------------
Please remember that this is alpha code at
best. Test it seriously before using in a production environment
A suggestion I just setup for my call center - instead of having different number for logging in and out, I made it one number. Its much easier for the agents:
[macro-custom-agent-inout]
exten => s,1,Wait(1)
exten => s,n,Set(CALLBACKNUM=${CALLERID(number)})
exten => s,n,AddQueueMember(${ARG1})
;If they're already logged in, log off
exten => s,n,GotoIf($["${AQMSTATUS}" = "MEMBERALREADY"]?a2)
exten => s,n,Playback(agent-loginok)
exten => s,n,UserEvent(Agentlogin,Agent: ${CALLBACKNUM})
exten => s,n,Hangup()
exten => s,n(a2),RemoveQueueMember(${ARG1})
exten => s,n,UserEvent(Agentlogoff,Agent: ${CALLBACKNUM})
exten => s,n,Playback(agent-loggedoff)
exten => s,n,Hangup()
that needs to be in the wiki (anyone can contribute;)
http://www.trixbox.org/wiki/additional-scripts-and-tricks
nice work, I will have to try it out in the next few days.
Skurylo,
Thanks for sharing the log in/out function for queues. This is something I've been wanting to make it easier for our customer service reps to get in/out of their queue. I'm having a little bit of trouble getting it to work and I was wondering if you might be willing to explain how you set it up in a little more detail. I've listed what I've done so far below.
1) Added your code to extensions-custom.conf and named the context [custom-agent-inout].
2) Went to Misc Applications in FreePBX and added a new misc app, gave it the feature code of 696. I then selected Custom App as the destination and put custom-agent-inout,s,1 in the Custom App textbox.
3) I created queue number 601.
Now, when I call 696 from my phone, I get an error saying the call failed on the LCD and a busy signal. The output from the Asterisk CLI is below:
[Jan 30 09:21:17] -- Executing [12@from-internal:1] NoOp("SIP/3684-b6b289e8", "Running miscapp 2: AgentLogInOut") in new stack
[Jan 30 09:21:17] -- Executing [12@from-internal:2] Goto("SIP/3684-b6b289e8", "custom-agent-inout|s|1") in new stack
[Jan 30 09:21:17] -- Goto (custom-agent-inout,s,1)
[Jan 30 09:21:17] -- Executing [s@custom-agent-inout:1] Wait("SIP/3684-b6b289e8", "1") in new stack
[Jan 30 09:21:18] -- Executing [s@custom-agent-inout:2] Set("SIP/3684-b6b289e8", "CALLBACKNUM=3684") in new stack
[Jan 30 09:21:18] -- Executing [s@custom-agent-inout:3] AddQueueMember("SIP/3684-b6b289e8", "") in new stack
[Jan 30 09:21:18] == Spawn extension (custom-agent-inout, s, 3) exited non-zero on 'SIP/3684-b6b289e8'
Off the top of your head, do you see a step that I'm missing or something I'm doing incorrectly?
Thanks again for sharing your code.
Andrew
For me, the AgentCallBackLogin line above isn't going to do the trick exactly. My end goal is to be able to have an agent call a single number and be logged in if they are currently logged off or logged off if they are currently logged in. I am also trying to automate this so that the users won't have to enter their agent ID, password, or extension. Our agents are always at the same desk with the same extension, so basically I want to be able to automate the whole thing for them.
I think that is what Skurylo does in the code, but I have to admit that I'm having trouble figuring it out for sure.
Andrew
We have a support number that clients call which is then routed to a queue. The agents in the queue have staggered shifts, so during work hours some agents should be taking calls while others aren't around to do so. The agents also have to leave their desks from time to time during their shifts, so I want them to be able to log out to get out of the queue. The agent who has received calls least recently should receive the next call.
I originally started out with the idea of having static agents and using DND to temporarily remove agents from the queue, but I ran into a couple of issues there. The DND button my GXP 2000 doesn't seem to take agents out of the queue b/c it isn't the same as the DND defined in Trixbox. I then wanted to use one of the programmable buttons to activate/deactivate the Trixbox DND for the extension. In trying to figure out how to do this with one button, I came across this thread, hence my posts.
It seems to me, and I suspect you as well, that the method I'm attempting to use is much too complex for what is necessary, but I haven't been able to accomplish this using other methods.
I've done a single number login/logout for AgentCallBackLogin with a single button agent pause feature as well. I did it by creating and/or updating a asterisk db entry to track the paused/unpaused status and do the appropriate thing. It was on asterisk 1.2, with snom 360s. The only thing that bugged me at the time was I wanted to turn on the LED for the log in and out button when a user was logged in and turn the pause/unpause LED on and off as well but didn't want to mess with bristuff for playing with blf stuff. Should be easy enough with 1.4.... I've got that code around here somewhere..... I'll see what I can find.
Tracy
Is it possible to get a "queue" voicemail, when there is no agent in that queue?
Has anyone an additional script/ solution for the queue callbacklogin / logoff?
My config:
agent 1 - queue 1 -> when logged in: forward to sip agent 1
agent 2 - queue 2 -> when logged in: forward to sip agent 2
agent 3 - queue 3 -> when logged in: forward to sip agent 3
etc.
My wish:
agent 1 - queue 1 -> when logged off: forward to voicemail agent 1
agent 1 - queue 1 -> when logged off: forward to voicemail agent 2
agent 1 - queue 1 -> when logged off: forward to voicemail agent 3
I hope you can help me..
greetings Jerry
The problem Ii get,
when the queue is empty, the caller is still being in the queue waiting line.
queues_additional.conf
[55501]
announce-frequency=60
announce-holdtime=no
eventmemberstatus=no
eventwhencalled=no
joinempty=yes
leavewhenempty=yes
maxlen=1
periodic-announce-frequency=60
queue-callswaiting=queue-callswaiting
queue-thankyou=queue-thankyou
queue-thereare=queue-thereare
queue-youarenext=queue-youarenext
retry=0
strategy=ringall
timeout=10
wrapuptime=5
context=ivr-3
periodic-announce=custom/all-lijnen-zijn-bezet
Are the settings wrong? using 2.6.0.0 FreeBPX

Member Since:
2006-06-21