0

I need to implement the below use-case in asterisk + adhearsion and not sure on how to do that

When a customer call comes. I check list of available agents if the agents are busy i need to put the call in a queue with a timeout. If the agents don't become free within the given timeout the call hangs-up otherwise call gets routed to the agent.

Any idea on how to implement this flow?

Kiran Raj
  • 187
  • 1
  • 9

1 Answers1

2

There are a few ways to implement this, your approach very much depends on how will you know if an agent is available? What I would recommend is:

  • Call comes in
  • Adhearsion router, routes the call to the inbound call controller
  • This in bound controller checks your list of agents
  • If the agent is available and not on a call you can use the "dial" command to call the agent and automatically join the two calls.
  • If the agent is available and has an active call you can use "join"
  • If there are no agents available then use the "play" command to play some hold music asynchronously, while you keep checking if an agent becomes available.
  • When you detect an agent is available you can then "stop" the hold music and dial the call to the agent.

In order to determine which agents are available you will need some sort of agent list and their associated status which you update as they take calls. Alternatively you can try pull some of this information directly from the asterisk extensions.conf file, or the DB if you are using PIAF.

Most of the code examples you need to write something like this are given on the Adhearsion website. http://www.adhearsion.com/docs

Edit:

The better way of approaching this now will be to use the ElectricSlide call queue module. There has been a lot of work done on it recently and it is now a pretty solid call queue.

https://github.com/adhearsion/electric_slide/


System123
  • 523
  • 5
  • 14