Howto: Dynamic Agents login/logout + Auto loggoff

mbrevda
Posts: 209
Member Since:
2006-06-21

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

--

Moshe Brevda, FreePBX/Schmooze Com Development Team



skurylo
Posts: 43
Member Since:
2007-10-11
A suggestion I just setup

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()



jahyde
Posts: 2002
Member Since:
2006-06-02
that needs to be in the wiki

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.

--

--my PBX is run on 2 V8's



nicho1ab
Posts: 49
Member Since:
2006-07-11
Use this in Misc Applications?

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



mudslide
Posts: 48
Member Since:
2006-08-24
doesn't the

doesn't the AgentCallBackLogin function do all of this in one step? I have been using it with the single number to login:
..
exten => 900,2,AgentCallbackLogin(||${CALLERIDNUM}@ext-local)
...

done



nicho1ab
Posts: 49
Member Since:
2006-07-11
For me, the

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



mudslide
Posts: 48
Member Since:
2006-08-24
ok, so you don't want them

ok, so you don't want them to have to bother with ID, password, extension... you have agents sitting at the same desk with the same extension... so why are you even bothering with login at all? Login is only required for hot desks.



nicho1ab
Posts: 49
Member Since:
2006-07-11
We have a support number

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.



carltont
Posts: 27
Member Since:
2006-05-31
I've Done That....

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



starlights
Posts: 18
Member Since:
2008-04-10
log out caller forwarded to Voicemail

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



mbrevda
Posts: 209
Member Since:
2006-06-21
sure. just set the f allover

sure. just set the fallover destination to the appropriate vm box

--

Moshe Brevda, FreePBX/Schmooze Com Development Team



starlights
Posts: 18
Member Since:
2008-04-10
The problem I get,

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



mbrevda
Posts: 209
Member Since:
2006-06-21
could be a bug. ive seen

could be a bug. ive seen something like that befor. what version are you on?

--

Moshe Brevda, FreePBX/Schmooze Com Development Team



starlights
Posts: 18
Member Since:
2008-04-10
version 2.6.0.0

Version: 2.6.0.0



fabianus
Posts: 18
Member Since:
2007-11-10
Hey kurylo, this is a great

Hey kurylo,

this is a great idea !

Thanks a lot for this contribution.

Regards,
Fabianus



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.