Sunday, March 04, 2012

Multi-company agent queues

Recently, we helped a customer to build a call center whereas his agent team needs to answer incoming calls for 4 companies.  The below requirements are of high priority.

  • agent is able to identify which company is being called so that she could prepare the appropriate greetings
  • company-specific call queue configurations (greetings, queue length, timeout, voicemail,agent structure)
  • call is sent to agent in specific order such that customer always talk to the more experienced agent first
  • visitor is sent to voicemail directly during non-office hours
  • calls must not go to agent's personal voicemail; they have to be circulated within the agent team until answered or queue timeout.

In the first place, we subscribed 4 HK DID from a HK ITSP and make changes in /etc/sip.conf below.

register => xxxxxxxx,secret@itsp_trunk
; we need to let this itsp know our SIP contact via REGISTRATION
; for receiving incoming calls
; this 'register' is required by this particular itsp

type = friend
host = itsp_trunk_ip
username = xxxxxxxx ; info required to send calls to itsp
secret = secret
nat = yes
disallow = all
allow = alaw,ulaw,gsm
canreinvite = no
dtmfmode = rfc2833
insecure = port,invite
context = agent_team

Next, we create 4 Asterisk queues and send them the corresponding calls in dial plan.  The company being called is shown as caller name on the agents' Grandstream IP Phones.
Specific call distribution order is achieved by queue member penalty.  Member with lower penalty always get call first.
GotoIfTime() is used to send visitor to voicemail during non-office hours.
The company-specific greetings, busy messages and non-office hour messages are put in /var/lib/asterisk/sounds/customized.

We also use a member timeout of 15s so as to avoid connecting to agent's personal voicemail (which has a longer timeout).

; queues of other 3 companies are defined similary
strategy = ringall
maxlen = 5
ringinuse = no
timeout = 15 ; we ring a member for 15s before considering timeout and ring the next agent
member => SIP/tina,1
member => SIP/johnson,2
member => SIP/may,2
member => SIP/kathy,3

; the DID numbers are 5804xxxx
exten => _XXXXXXXX,1,noop(Enter Queue)
exten => _XXXXXXXX,n,Set(company=${IF($[ ${EXTEN} = 58041231]?company-a)})
exten => _XXXXXXXX,n,Set(company=${IF($[ ${EXTEN} = 58041232]?company-b:${company})})
exten => _XXXXXXXX,n,Set(company=${IF($[ ${EXTEN} = 58041233]?company-c:${company})})
exten => _XXXXXXXX,n,Set(company=${IF($[ ${EXTEN} = 58041234]?company-d:${company})})

; we jump to 'closed' extension after office hours
exten => _XXXXXXXX,n,GotoIfTime(18:15-09:00,mon-fri,*,*?closed)
exten => _XXXXXXXX,n,GotoIfTime(*,sat-sun,*,*?closed)
exten => _XXXXXXXX,n(office-hr),answer
exten => _XXXXXXXX,n,wait(1)
exten => _XXXXXXXX,n,Playback(customized/${company}-greeting)
; agent ip phone will show the company as caller name
; so she could prepare greetings accordingly
exten => _XXXXXXXX,n,Set(CALLERID(name)="${company}")
exten => _XXXXXXXX,n,Queue(${company}-queue|Tt|||180)
exten => _XXXXXXXX,n,Playback(customized/${company}-busy)
exten => _XXXXXXXX,n,Voicemail(${EXTEN}@agent_team)
exten => _XXXXXXXX,n,Hangup()
exten => _XXXXXXXX,n(closed),Playback(customized/${company}-after-hours)
exten => _XXXXXXXX,n,Voicemail(${EXTEN}@agent_team)
exten => _XXXXXXXX,n,Hangup()

; each agent queue has its own voicemail
; where the voicemail name is same as the DID number
XXXXXXXX => XXXXXXXX,company-a,,,attach=yes|format=wav49
; the other 3 voicemails are defined similarly


No comments:

Post a Comment