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



  1. Thank you very much for your information.
    Australia ETA/eVisitor Visa
    is quiet easy to apply online from Singapore,
    Malaysia, United Kingdom, United States, Canada, France and including all others ETA Eligible Countries from our website.

  2. admire views of the Yas Marina Formula 1 circuit and Ferrari World, and visit the Heritage Village to learn about Abu Dhabi’s pre-oil past and Bedouin beginnings. Informative guided commentary, round-trip transport, and Dubai hotel pickup and drop-off are included.abu dhabi city tour

  3. Dubai city tour is all about remarkable transformation – from a small pearl village to a world class epicenter of 5 star experiences – that is Dubai, UAE’s pride! Over the years Dubai has become the leading destination for holidays around the world. It has to be; with so many attractions and beautiful sandy beaches to claim, no wonder that millions flock to this city to see what it’s about. Take a city tour Dubai and experience for yourself.
    Dubai city tour