Voximplant. Blog

Step-by-step call center tutorial part 3

Creating a call queue

The application we created at the previous step has a flaw: it’s unclear what to do if the second user calls while the first one is still talking to the operator. Our web and mobile SDK can accept multiple incoming calls (and the phone app supports two lines to demonstrate it), but a human operator can speak only with one person at a time. This can be solved by a call queue: while the operator speaks with a user, all other users are waiting in a queue, with optional waiting music being played and/or the synthesized message informing the users about the remaining waiting time.

VoxImplant provides the Call Queue abstraction to automatically handle a queue of incoming calls. To use a queue, you need to create a queue object. Open the VoxImplant control panel, select Settings on the top menu and click Queues. The queue control interface will be displayed. Click Add queue and enter the queue name. At this step, name the queue ‘main’ and click Add to confirm the operation.
queues

 

joxi_screenshot_1491400636347

After the queue is created, it can be used instead of callUser to enqueue the calls to the call center. But if there’s more than one operator available, how to define which one will receive the call? For this purpose, we have a skill group concept that adds operators into a queue and assigns target operators to handle specific questions. For a call queue to work, you need to add a skill group and users to it. Open the VoxImplant control panel, select Settings on the top menu and click Skills. Click Create skill and enter the skill name. At this step, name the skill ‘general’, select the queue named ‘main’ and click Assign users to select the user you added at the previous step. Click Add to confirm the new skill creation. The call queue itself works like a filter: it allows to enqueue requests only to operators who have all the skills that are set for the specific queue. Queues also provide additional features like priority or maximum wait duration.
skills-menu

 

joxi_screenshot_1491400826492

 

Modify the code created at the previous step by using enqueueACDRequest instead of callUser and subscribing to the queue events:

  1. require(Modules.ACD);
  2.  
  3. VoxEngine.addEventListener(AppEvents.CallAlerting, function(e) {
  4. var inc = e.call;
  5. var incId = e.callerid;
  6. inc.answer();
  7. inc.addEventListener(CallEvents.Connected, function() {
  8. var request = VoxEngine.enqueueACDRequest("main", incId);
  9. request.addEventListener(ACDEvents.OperatorReached, function (e) {
  10. var out = e.operatorCall;
  11. VoxEngine.sendMediaBetween(inc, out);
  12. });
  13. });
  14. });

With the updated scenario, the second caller will not be connected to the operator until the first finishes his or her conversation. This simple example also has a few pitfalls that you need to keep in mind:

  • Voximplant web phone have special engines to work with the call queues. The operator needs to change his or her status to ‘ready’ to be able to receive calls. If the operator fails to answer the call, he or she becomes non-responsive and the status is changed to ‘banned’ for some time. Then the operator needs to change the status to ‘online’ and then to ‘ready’.
  • Up to this step, the scenario doesn’t have any code to handle user disconnections. So, if a user terminates a phone call, the operator will not be disconnected automatically. To accept the second user’s call, the operator needs to manually click Disconnect. At the next step, we will show how you can handle disconnections properly.

To troubleshoot the call queue, use the queue control panel interface. Click Refresh to the right of the queue row to see the number of users talking to operators, users waiting in the queue and number of operators. All Voximplant control panel features are also available via HTTP API

Tagged in

Comments