Author Topic: Dynamic Agents and Asterisk ARA  (Read 11823 times)

supertle

  • Newbie
  • *
  • Posts: 13
  • Karma: 0
    • View Profile
    • Email
Dynamic Agents and Asterisk ARA
« on: July 17, 2008, 16:33:41 »
In our callcenter, we allow an agent to dynamically sit wherever they want.  So we have no idea where they are until they actually log in.  We give out a separate loginID# to each agent to use for logging in.  When they log in,  the agent enters the extension# of the phone they are sitting at and I track this in mysql database.  I then add in the extension interface they entered using ADDQUEUEMEMBER to the queue(s) they belong to as they log in.  When they logoff, I lookup interface in the database and remove that interface out of the queue.

I have a table in my Asterisk ARA database call Agents which basically has two columns

AgentID    |     Location
ABC_1001       SIP/1104
ABC_1002       SIP/1109
ABC_1003       LOGOUT
ABC_1004       LOGOUT
ABC_1005       LOGOUT

I use the RealTimeUpdate and RealTime command in my Asterisk dialplan to update these entries.  How can I associate and show the AgentIDs rather then the INTERFACE in the queues.  I have a custom web GUI that displays the AgentID and the location they are sitting at but that would not work too well if say agent ID1001 was sitting at 1104 and leaves for the day and then agentID1005 comes in at night and sits at extension SIP/1104.   

Sorry if this may have been covered in the documents somewhere but I have looked through many and not found anything.  I only found about tracking dynamic agents as they log in and logoff.  I can echo the agentID (i.e. ABC_1001) during the logon/logoff process but then later when SIP/1104 gets calls, I don't see how to connect the relationship as Asterisk does not know anything about my ABC_1001 when it writes to queue_log.  I'm running on Asterisk 1.2 (ABE-B).  Will be upgrading to 1.4 very soon.

QueueMetrics

  • Loway
  • Hero Member
  • *
  • Posts: 2999
  • Karma: 39
    • View Profile
    • QueueMetrics
Re: Dynamic Agents and Asterisk ARA
« Reply #1 on: July 22, 2008, 09:07:39 »
The problem with this is that QM actually uses the interface name as it's logged for the agent name. One siomple thjing that comes to my mind is: you could try using Local/1234@agents for agents, where 1234 is the agent code, and the [agents] context takes an agent id, does a DB lookup and calls the required SIP terminal. Do you think this would be OK?
 

supertle

  • Newbie
  • *
  • Posts: 13
  • Karma: 0
    • View Profile
    • Email
Re: Dynamic Agents and Asterisk ARA
« Reply #2 on: July 24, 2008, 18:17:42 »
This looks to be a solution.  So you are suggesting when we add a dynamic member to a queue, to use agent@context as the interface to be added in.  Will try it out and let you know.  Do you see any other alternative that would involve only tweaking with QM?  Reason is b/c we have many customers and hundreds of queues that we would have to go back and re-modify/test out to make it compatible with QM. 

supertle

  • Newbie
  • *
  • Posts: 13
  • Karma: 0
    • View Profile
    • Email
Re: Dynamic Agents and Asterisk ARA
« Reply #3 on: July 24, 2008, 21:50:41 »
i did what you suggested and its working great.  Now I see local/AgentID@context in QM.  I think I can work with this.  It was much easier then I thought.  Now I just have to test to make sure context interface within a queue works the same way as having a "real" interface in the queue. 

One question I have is though ... I am noticing if I add the following interfaces to my queues

Local/1001@Customer1 to Queue1
Local/1001@Customer2 to Queue2

QM is recognizing this as the same Agent when in fact its two different agents.
« Last Edit: July 24, 2008, 22:10:27 by supertle »

supertle

  • Newbie
  • *
  • Posts: 13
  • Karma: 0
    • View Profile
    • Email
Re: Dynamic Agents and Asterisk ARA
« Reply #4 on: July 24, 2008, 23:03:29 »
Also, the realtime monitoring is looking good but when I run reports on the queue.  It is showing the phone extension rather then the Local/agent@context.  The reports does not show anything about these Local/Agents@context answering calls.  It shows the SIP/XXXX devices answering the call.

QueueMetrics

  • Loway
  • Hero Member
  • *
  • Posts: 2999
  • Karma: 39
    • View Profile
    • QueueMetrics
Re: Dynamic Agents and Asterisk ARA
« Reply #5 on: July 26, 2008, 16:57:34 »

Local/1001@Customer1 to Queue1
Local/1001@Customer2 to Queue2

QM is recognizing this as the same Agent when in fact its two different agents.

Yes - QM will turn the Local/XXX@ctxt to Agent/XXX no matter what the context is. You should use distinct IDs for each agent.
 

QueueMetrics

  • Loway
  • Hero Member
  • *
  • Posts: 2999
  • Karma: 39
    • View Profile
    • QueueMetrics
Re: Dynamic Agents and Asterisk ARA
« Reply #6 on: July 26, 2008, 16:59:09 »
Also, the realtime monitoring is looking good but when I run reports on the queue.  It is showing the phone extension rather then the Local/agent@context.  The reports does not show anything about these Local/Agents@context answering calls.  It shows the SIP/XXXX devices answering the call.

This should be easy - try switching the value here:

Code: [Select]
#If a channel name is different when the call is opened from when it's closed, which one to use?
default.useEndingChannelName=true

Try setting to "true" or "false".

supertle

  • Newbie
  • *
  • Posts: 13
  • Karma: 0
    • View Profile
    • Email
Re: Dynamic Agents and Asterisk ARA
« Reply #7 on: August 12, 2008, 15:30:45 »
I tried what u suggested in:
default.useEndingChannelName=true
default.useEndingChannelName=false

and it does not make a difference with either.  In the report, it shows the agentID as the SIP/XXXX.  I need to be able to group the reports by the actual AgentID and not where the agent happenned to be sitting at the time he logged in at.  We can have many agents sitting at the same SIP/XXXX location so looking at a report grouped by phone locations does not help.

I am adding the agents in using addmemberqueue as you suggested Local/AgentID@CustomerContext. 
I have default.rewriteLocalChannels=true which is displaying the Agent ID great in the realtime monitoring but when the call is answered, it still shows the SIP/XXXX answering the call.

We have over thousands of agents that is configured like this in our database:

ABC_1001
...
ABC_1999

QST_1001
...
QST_1999

XYZ_1001
...
XYZ_1999

Each customer is assigned with a different 3 digit code.  We have many customers and these 3 digit code is how we are distinguishing agents between each customers.  Do I need to do something in the context CustomerContext to send to the queue_log to tell queuemetrics that it is this AgentXXXX@CustomerContext  answering the call and not SIP/XXXX??

QueueMetrics

  • Loway
  • Hero Member
  • *
  • Posts: 2999
  • Karma: 39
    • View Profile
    • QueueMetrics
Re: Dynamic Agents and Asterisk ARA
« Reply #8 on: August 12, 2008, 16:46:02 »
Can you post an example of a call taken from your queue_log file? and explain what went on during that call?

supertle

  • Newbie
  • *
  • Posts: 13
  • Karma: 0
    • View Profile
    • Email
Re: Dynamic Agents and Asterisk ARA
« Reply #9 on: August 12, 2008, 18:28:40 »
1218557396|1218557354.172|NONE|Local/2301@Customer1|AGENTLOGIN|-
1218557399|1218557354.172|NONE|Local/2301@Customer1|AGENTLOGIN|-
1218557442|1218557442.173|Customer1-q6831|NONE|ENTERQUEUE||ARS_GW1
1218557486|1218557442.173|Customer1-q6831|SIP/1104-0087e4b0|CONNECT|44
1218557831|1218557442.173|Customer1-q6831|SIP/1104-0087e4b0|COMPLETECALLER|44|345


Here's a snippet of an agent logging into a queue.  Follow by a call into that queue.  How can I tweak what's written above of having SIP/1104 to agent/2301 as the one answering and completing the call. 

supertle

  • Newbie
  • *
  • Posts: 13
  • Karma: 0
    • View Profile
    • Email
Re: Dynamic Agents and Asterisk ARA
« Reply #10 on: August 12, 2008, 21:15:38 »
on a side note, using agent context dialing with the local_channel@customer1 causes some minor nuisances with the TRANSFERS. 

When you initiate a transfer, it looks in this same customer1 context for a match rather then the phone's context specified in the sip.conf file.  B/c my agentID and my extensions are the same, I am using a  temporary work around to have the agents enter a "9" if they want to transfer to an extension.  If they transfer by entering in an agent's ID, then just the 4 digit is fine however I'm having difficulties trying to figure out how to handle things such as a VM in this customer1 context. 

My customer1 context is pretty simple the way it is:

[customer1]

exten => _xxxx,1,RealTimeLookup(.....)  Find out the extension of the agent
exten => _xxxx,2,Dial(sip/xxxx)

I can't start adding things like priority 3 and sending it to VM b/c that will cause regular calls from the queue into voicemail.  Any suggestions welcomed.

supertle

  • Newbie
  • *
  • Posts: 13
  • Karma: 0
    • View Profile
    • Email
Re: Dynamic Agents and Asterisk ARA
« Reply #11 on: August 12, 2008, 21:55:16 »
Nevermind, I found a fix for this

http://www.voip-info.org/wiki/view/Asterisk+local+channels

Add a /n to the local_channel@customer1/n when adding this member into a queue.  Works like a charm.

supertle

  • Newbie
  • *
  • Posts: 13
  • Karma: 0
    • View Profile
    • Email
Re: Dynamic Agents and Asterisk ARA
« Reply #12 on: August 12, 2008, 22:27:04 »
1218571546|1218571545.544|Xerox-q6831|NONE|ENTERQUEUE||ARS_GW1
1218571605|1218571586.153|NONE|Local/2301@Xerox2|AGENTLOGIN|-
1218571608|1218571586.153|NONE|Local/2301@Xerox2|AGENTLOGIN|-
1218571613|1218571545.544|Xerox-q6831|Local/2301@Xerox2-7b57,1|CONNECT|67
1218571695|1218571545.544|Xerox-q6831|Local/2301@Xerox2-7b57,1|COMPLETECALLER|67|82

Actually since adding that /n to my dynamic members, everything is going great how asterisk reports the calls now to the queue_log

I think this issue is fixed* but I will have tons more of questions :)

QueueMetrics

  • Loway
  • Hero Member
  • *
  • Posts: 2999
  • Karma: 39
    • View Profile
    • QueueMetrics
Re: Dynamic Agents and Asterisk ARA
« Reply #13 on: August 13, 2008, 15:16:28 »
yes this looks fixed. feel free to post other questions (better if on different threads) if you have other topics we can help you on.