Re: [Asterisk-Users] Queue and Agent functionality

2004-09-26 Thread Nicolás Gudiño
Hello,

On Sun, 26 Sep 2004 00:49:35 -0400, Robert Jackson
[EMAIL PROTECTED] wrote:
 
[snip] 
  4. If a caller empties a handled queue (active agents) with
  no callers, the caller will still hear messages (you are
  first in queue, etc.).  This should not occur.  Someone
  posted a 2-line patch on -dev list recently to fix this issue.
  
 The patch works for us.  I am assuming this will end up in CVS
 soon.

If  there is really an interest for this tiny patch I can post it to
bugs.digium.com today.  I don't know if Mark's or the author of the
queues position announcements are ok with it..

Regards,

-- 
Nicolás Gudiño
Buenos Aires - Argentina
___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


RE: [Asterisk-Users] Queue and Agent functionality

2004-09-25 Thread Marco Nicolayevsky
Chris,

I agree with your assessment of asterisk's queues. I took Robert's reply to
my original post, and came up with a way to tackle your first scenario (no
agents in queue=caller in limbo) with his idea of setting variables. My idea
deals with setting global variable states for each agent. I only have 4
agents, so it should work for me fairly easily. In the extensions.conf file
I would have something like this:

[globals]
GCSR1=off
GCSR2=off
GCSR3=off
GCSR4=off  

Then, in the context where my agents log in/out of queue, I set the global
variable to on/off depending on their action. When the agent dials 800,
GCSR1 becomes 'on'. When they dial 801##, GCSR1 becomes 'off'.

[fromcsr1]
exten= 800,1,AgentCallbackLogin(101|[EMAIL PROTECTED])
exten= 800,2,SetGlobalVar(GCSR1=on)
exten= 800,3,Hangup
exten= 801,1,AgentCallBackLogin(101)
exten= 801,2,SetGlobalVar(GCSR1=off)
exten= 801,3,Hangup


Then, in my queue, I check for the value of GCSR1 before dumping them to the
queue. Otherwise, dump them to VM. Obviously, the GotoIf would have to check
if GCSR1 = on | GCSR2 = on | GCSR3 = on | etc... For my testing, I was just
using GCSR1.

[queue]
exten = 1,1,DigitTimeout,1
exten = 1,2,ResponseTimeout,1
exten = 1,3,GotoIf($[${GCSR1} = on]?4:5)
exten = 1,4,Queue(order|tT)
exten = 1,5,Goto(generalvm|s|1)


While this idea seems to make sense (in my head), I am unable to make it
work. For example, my GotoIF command does work, so the value of GCSR1 will
determine which path the caller takes. The part that doesn't work is in the
[fromcsr] context. My SetGlobalVar(GCSR1=on) seems to have no effect,
therefore, making my solution not work.

Does anyone have any ideas?

Thanks,

Marco



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Chris Icide
Sent: Saturday, September 25, 2004 1:34 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: [Asterisk-Users] Queue and Agent functionality

I've seen alot of posts lately on Queue and Agent functionality, and alot of
hacks to make them do different things that most call center managers want.

In the sake of doing this one time, I'd like to develop a single list of
request so we can consolidate a feature request for the Queue/Agent system.

Here are the ones that I run into the most:

1.  Queue should know the status of agents assigned to a queue and act
accordingly.

 Here are a couple examples of the problem.  

A queue has no agents logged in and handling the queue, a call comes in for
the queue, the call remains in the queue until either an agent logs in, or
the queue reaches it's timeout.  What it should do is immediately time out
setting priority +101.  Normal timeout (caller in busy queue with agents
active) should exit with priority set +1.

A Queue has active agents in a prioritized fashion.  Agent 1 is priority 1,
2 is 2, 3 is 3, and 4 is 4.  Agent 1 needs to make an outbound call as does
agent 2.  Both are now 'busy'.  The Queue still attempts to call agent 1,
gets 'busy' back from the sip device (i've only tried this with sip), and
then the system appears to wait for something like 7-8 seconds before trying
the next agent in line.

2. The queue system should allow a set of messages to be played at specific
times.  For example, a message that is played upon entry into the queue and
no other time, the current set of messages played every frequency=XX, a
message played to the caller when the call is accepted by an agent (eg
transfering), finally, a set of messages played to the user based upon a
predefined period int he config file.. see example below

message1-time=time in seconds
message1-frequency=never|once|always
message1=message1-file-loc

message2-time=time in seconds
message2-frequency=never|once|always
message2=message2-file-loc

Where a message messageX-file-loc is played never|once|always every
time in seconds.

if time is set to 0, or freqency is set to never, the message is not played.

If time is set to 0, and frequency is set to once, message is played at
messagex-time, and never again.

if time is set to 0 and frequency is set to always, message is played every
messagex-time in seconds.

3.  Agent timeout (logs the agent off if they do not respond to a ring in a
defined about of time) does not track across calls.  For example, if an
agent steps away and forgets to log out, then thier phone will ring based
upon whatever call strategy is used.  If the agent timeout is set higher
than the time the queue polls a set of agents they will never be logged out.
The timer needs to increment per agent across multiple polls.  So if my
queue poll timer is 20 secons, but the agent timeout is set to 60 seconds,
the preferred function would be to log the agent out of the queue if they
completely miss three poll events.

4. If a caller empties a handled queue (active agents) with no callers, the
caller will still hear messages (you are first in queue, etc.).  This should
not occur.  Someone posted a 2-line patch on 

RE: [Asterisk-Users] Queue and Agent functionality

2004-09-25 Thread Philipp von Klitzing
Hi!

 [fromcsr1]
 exten= 800,1,AgentCallbackLogin(101|[EMAIL PROTECTED])
 exten= 800,2,SetGlobalVar(GCSR1=on)
 exten= 800,3,Hangup

 determine which path the caller takes. The part that doesn't work is in the
 [fromcsr] context. My SetGlobalVar(GCSR1=on) seems to have no effect,
 therefore, making my solution not work.
 
 Does anyone have any ideas?

Unfortunately AgentCallbackLogin() _itself_ initiates the hangup, which 
means that any following priorities in your dialplan are useless. Besides 
your approach isn't yet perfect, what if an agent gets auto-logged out 
because he/she hasn't answered within the time limit?

Cheers, Philipp


___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [Asterisk-Users] Queue and Agent functionality

2004-09-25 Thread John Congdon
Here is my resolution to the problem, I use AgentLogin vs 
AgentCallBackLogin.
This is a long post, but I think it is very useful... :)

Call comes in via DID, queueable is a macro I wrote.  ty_voice and 
voice are
two sound files.  The first one is used to play a Thank you for calling 
XXX.
The second is what the agent will here so they know what number was 
dialed.

//Agents Dial 7100 to login
exten = 7100,1,Answer()
exten = 7100,2,AGI,SetAgent.agi
exten = 7100,3,AgentLogin(${AgentID})
//My AGI just gets the AgentID, verifies it exists and
//then adds it to the queue.  This is done through an
//AGI because I add every agent to multiple queues
//
// I then have a script in my timeclock programming that when
// our employees Clock out they are removed from all queues.
//
// I did have it set so that when the employee clocked in, they were
// added to the queues automatically, but this causes problems when
// they are supposed to clock in but not get on the phones right away.
#!/usr/bin/perl
use Asterisk::AGI;
use Asterisk::Manager;
$AGI = new Asterisk::AGI;
open (F, /etc/asterisk/agents.conf);
while (F) {
 if ($_ =~ /^agent = (\d*),(\d*),(.*)/) {
$Agent{$1} = 1;
 }
}
close(F);
my %input = $AGI-ReadParse();
$ID = $AGI-get_data(agent-user, 3000, 3);
$ID =~ s/#//g;
while ((!$Agent{$ID})  ($Count  5)) {
 $AGI-stream_file(agent-incorrect);
$ID = $AGI-get_data(agent-user, 3000, 3);
$ID =~ s/#//g;
  $Count++;
}
if (!$Agent{$ID}) {
 $AGI-stream_file(agent-incorrect);
 exit;
}
$AGI-set_variable('AgentID', $ID);
$AGI-exec('AddQueueMember', 'PlaceOrders|Agent/'.$ID);

// This sets up for incoming calls, and passing them to a queue
exten = 1022,1,Macro(queueable,ty_voice, voice)
[macro-queueable]
exten = s,1,answer
exten = s,2,Wait(2)
exten = s,3,Playback(${ARG1})
exten = s,4,SetVar(Announce=${ARG2})
exten = s,5,Goto(MainMenu|s|1)
[MainMenu]
All s, extensions are used to play the menu
exten = s,1,Playback(MayBeRecorded)
exten = s,2,BackGround(Orders)
exten = s,3,BackGround(digits/1)
...
exten = s,18,WaitExten(15)
exten = s,19,Goto,2
# If 1 is pressed
exten = 1,1,PlayBack,hold_pcs # Play a please hold message
exten = 1,2,Queue(PlaceOrders|t||${Announce})
exten = 1,3,Goto(9|2)

On Saturday, September 25, 2004, at 05:43  PM, Marco Nicolayevsky wrote:
Chris,
I agree with your assessment of asterisk's queues. I took Robert's 
reply to
my original post, and came up with a way to tackle your first scenario 
(no
agents in queue=caller in limbo) with his idea of setting variables. 
My idea
deals with setting global variable states for each agent. I only have 4
agents, so it should work for me fairly easily. In the extensions.conf 
file
I would have something like this:

[globals]
GCSR1=off
GCSR2=off
GCSR3=off
GCSR4=off
Then, in the context where my agents log in/out of queue, I set the 
global
variable to on/off depending on their action. When the agent dials 800,
GCSR1 becomes 'on'. When they dial 801##, GCSR1 becomes 'off'.

[fromcsr1]
exten= 800,1,AgentCallbackLogin(101|[EMAIL PROTECTED])
exten= 800,2,SetGlobalVar(GCSR1=on)
exten= 800,3,Hangup
exten= 801,1,AgentCallBackLogin(101)
exten= 801,2,SetGlobalVar(GCSR1=off)
exten= 801,3,Hangup
Then, in my queue, I check for the value of GCSR1 before dumping them 
to the
queue. Otherwise, dump them to VM. Obviously, the GotoIf would have to 
check
if GCSR1 = on | GCSR2 = on | GCSR3 = on | etc... For my testing, I was 
just
using GCSR1.

[queue]
exten = 1,1,DigitTimeout,1
exten = 1,2,ResponseTimeout,1
exten = 1,3,GotoIf($[${GCSR1} = on]?4:5)
exten = 1,4,Queue(order|tT)
exten = 1,5,Goto(generalvm|s|1)
While this idea seems to make sense (in my head), I am unable to make 
it
work. For example, my GotoIF command does work, so the value of GCSR1 
will
determine which path the caller takes. The part that doesn't work is 
in the
[fromcsr] context. My SetGlobalVar(GCSR1=on) seems to have no effect,
therefore, making my solution not work.

Does anyone have any ideas?
Thanks,
Marco

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Chris 
Icide
Sent: Saturday, September 25, 2004 1:34 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: [Asterisk-Users] Queue and Agent functionality

I've seen alot of posts lately on Queue and Agent functionality, and 
alot of
hacks to make them do different things that most call center managers 
want.

In the sake of doing this one time, I'd like to develop a single list 
of
request so we can consolidate a feature request for the Queue/Agent 
system.

Here are the ones that I run into the most:
1.  Queue should know the status of agents assigned to a queue and act
accordingly.
 Here are a couple examples of the problem.
A queue has no agents logged in and handling the queue, a call comes 
in for
the queue, the call remains in the queue until either an agent logs 
in, or
the queue reaches it's timeout.  What it should do is immediately time 
out
setting priority +101.  Normal timeout (caller 

RE: [Asterisk-Users] Queue and Agent functionality

2004-09-25 Thread Robert Jackson

 -Original Message-
 From: Chris Icide [mailto:[EMAIL PROTECTED] 
 Sent: Saturday, September 25, 2004 2:34 PM
 To: Asterisk Users Mailing List - Non-Commercial Discussion
 Subject: [Asterisk-Users] Queue and Agent functionality
 
 
 1.  Queue should know the status of agents assigned to a 
 queue and act accordingly.
 
Agreed.  I propose that * actually monitors the channel
that the agent logs in from.  At the very least it keeps
* from trying to pass calls to agents that are on outbound
calls. 

 2. The queue system should allow a set of messages to be 
 played at specific times.  

This is also a very important in a typical call center.

 3.  Agent timeout (logs the agent off if they do not respond 
 to a ring in a defined about of time) does not track across 
 calls.  For example, if an agent steps away and forgets to 
 log out, then thier phone will ring based upon whatever call 
 strategy is used.  If the agent timeout is set higher than 
 the time the queue polls a set of agents they will never be 
 logged out.  The timer needs to increment per agent across 
 multiple polls.  So if my queue poll timer is 20 secons, but 
 the agent timeout is set to 60 seconds, the preferred 
 function would be to log the agent out of the queue if they 
 completely miss three poll events.
 
Agreed.

 4. If a caller empties a handled queue (active agents) with 
 no callers, the caller will still hear messages (you are 
 first in queue, etc.).  This should not occur.  Someone 
 posted a 2-line patch on -dev list recently to fix this issue.
 
The patch works for us.  I am assuming this will end up in CVS
soon. 

I was planning to start coding on #1 this week as it is causing
us much heartache.  Please let me know any suggestions that you 
may have as to the best way to go about it.  As I said above
I was planning on either using a function similar to do_monitor in
chan_sip which would monitor the actual channel that the agent
logged in from or putting more code in the check_availability. 

I am also going to take a look at #3 while I have things opened up.

Please let me know if we are on the same page.


Robert Jackson
___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


RE: [Asterisk-Users] Queue and Agent functionality

2004-09-25 Thread Marco Nicolayevsky
Philipp...

Good point. I totally missed the auto-logoff angle. At this time, I'm not
using auto-logoff, but I really should.

Are you saying that the reason my code was not working is because
AgentCallbackLogin() invalidates the lines afterwards? In my example, the
global variable was not being set--or at least that's my best guess as to
why it was not working. I can try setting the global variable FIRST, and the
follow by using the AgentCallbackLogin().

Ok, I'm going to follow on the path that Robert mentioned a few e-mails back
re: using the monestary script. I've experimented by telneting into the
manager CLI, and was able to sucessfully get the 'show agents' command to
work.

Besides telneting into the manager CLI (or writing a script to do this), is
there any other way to run this command and capture the results?

Asuming I have to write a perl script similar to monestary one, what should
I do once I determine if there is an agent logged in? Am I able to set an *
global variable from within this external perl script? If not, what do you
suggest?

Thanks,

Marco









-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Philipp von
Klitzing
Sent: Saturday, September 25, 2004 5:03 PM
To: [EMAIL PROTECTED]
Subject: RE: [Asterisk-Users] Queue and Agent functionality

Hi!

 [fromcsr1]
 exten= 800,1,AgentCallbackLogin(101|[EMAIL PROTECTED])
 exten= 800,2,SetGlobalVar(GCSR1=on)
 exten= 800,3,Hangup

 determine which path the caller takes. The part that doesn't work is 
 in the [fromcsr] context. My SetGlobalVar(GCSR1=on) seems to have no 
 effect, therefore, making my solution not work.
 
 Does anyone have any ideas?

Unfortunately AgentCallbackLogin() _itself_ initiates the hangup, which
means that any following priorities in your dialplan are useless. Besides
your approach isn't yet perfect, what if an agent gets auto-logged out
because he/she hasn't answered within the time limit?

Cheers, Philipp


___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

!DSPAM:4155ea5e217701945313673!


___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users