📜 ⬆️ ⬇️

Call center with ACD, skill groups and WebRTC client for handling incoming calls

Calling queues and distributing calls to operators is one of the main tasks of the call center serving incoming calls when the number of calls exceeds the number of available operators (standard situation for most call centers). The caller is queued under a certain number, which the IVR informs him of, and plays music, periodically telling about the change in place in the queue and the expected waiting time (before the operator answers). If you're lucky, the music will be pleasant, and the wait is not too long. Want to learn how to quickly organize a call center with the described functionality, without getting into the wilds and the complexity of IP-telephony - welcome under the cat.
To implement our task, we will use the functionality of the VoxImplant platform, thanks to which we will only need knowledge of JavaScript, as well as we will use the ACD module, which is connected directly to the call processing script. Thanks to this module code writing will be kept to a minimum.

If you break the task into parts, you get the following list:
  1. Create an application VoxImplant (you can pathetically call it callcenter)
  2. We create users and hook them to the application (in our case, the users of the application are call center operators)
  3. Create and set up a queue for our application.
  4. Create and set up a skill group
  5. Create a VoxEngine script that will process incoming calls: put them in a queue, tell how long to wait for an answer, etc.
  6. We send all incoming calls to our script using the rule (rule) of the application
  7. Making a web operator interface using Web SDK

It looks scary, but as they say, the eyes are afraid, and the hands do. Let's get started

VoxImplant application


Open the Applications / Applications section in the control panel and create a new application. Let's call it callcenter. The full name of the application will be as follows callcenter.your_account.voximplant.com
')

Users / Operators


Open the Users section and create several users, you can call them operator1, operator2, etc. When creating them, you can immediately attach to the application that we created before this.

Creating a queue


Open the Queues section (in the Settings menu) and create a new queue with the following parameters:


Creating skill groups


Open the Skills / Skill Groups section (in the Settings menu) and create a new group, specify the queue and the users we created earlier:


Creating a VoxEngine script


Open the Scenarios / Scripts section and create a new script:
//   ACD require(Modules.ACD); var request, // <--     ACDRequest originalCall, // <--   callerid, statusInterval; //     VoxEngine.addEventListener(AppEvents.CallAlerting, handleInboundCall); //    function handleInboundCall(e) { originalCall = e.call; callerid = e.callerid; //   originalCall.addEventListener(CallEvents.Connected, handleCallConnected); originalCall.addEventListener(CallEvents.PlaybackFinished, handlePlaybackFinished); originalCall.addEventListener(CallEvents.Failed, cleanup); originalCall.addEventListener(CallEvents.Disconnected, cleanup); //    originalCall.answer(); } //   function cleanup(e) { if (request) { //     -  request.cancel(); request = null; } //   VoxEngine.terminate(); } //         function handlePlaybackFinished(e) { e.call.startPlayback("http://cdn.voximplant.com/toto.mp3"); } //   function handleCallConnected(e) { //     'MainQueue',       request = VoxEngine.enqueueACDRequest("MainQueue", callerid); //          request.addEventListener(ACDEvents.Queued, function (acdevent) { request.getStatus(); }); //           request.addEventListener(ACDEvents.Waiting, function (acdevent) { var minutesLeft = acdevent.ewt + 1; var minutesWord = " ."; if ((minutesLeft > 10 && minutesLeft < 20) || (minutesLeft % 10 > 4 || minutesLeft % 10 == 0)) { minutesWord = " ."; } else if (minutesLeft % 10 == 1) { minutesWord = " ."; } originalCall.say("      " + acdevent.position + ".       " + (acdevent.ewt + 1) + minutesWord, Language.RU_RUSSIAN_FEMALE); }); //    request.addEventListener(ACDEvents.OperatorReached, function (acdevent) { VoxEngine.sendMediaBetween(acdevent.operatorCall, originalCall); acdevent.operatorCall.addEventListener(CallEvents.Disconnected, VoxEngine.terminate); clearInterval(statusInterval); }); //    -       request.addEventListener(ACDEvents.Offline, function (acdevent) { originalCall.say(" ,    . ,   .", Language.RU_RUSSIAN_FEMALE); originalCall.addEventListener(CallEvents.PlaybackFinished, function (e) { VoxEngine.terminate(); }); }); //      30  statusInterval = setInterval(request.getStatus, 30000); } 

Call the script 'ACD' and save. Now you can take some phone number in VoxImplant to send all calls from it to our IVR with a queue.

Connect the number


We open the Phone numbers section and you can purchase a number directly in it:

In the section My numbers we catch the number to our application:


We send incoming calls from the room to the script


Go to the Applications / Applications section, go to the application editing and open the Rules section, click Add Rule / Add rule. You can call it InboundCalls, insert the acquired phone number into the Pattern and it remains to drag our ACD script to the Assigned / Bound column:

Click Add and see the rule you just created:


Creating a call center operator interface


The last thing you need to do is create a simple web interface in which operators will work. This can be done using the Web SDK from VoxImplant, in modern browsers WebRTC will be used in this case. To set the current operator status in the Web SDK, the setOperatorACDStatus function is available , where we will transfer one of the statuses from VoxImplant.OperatorACDStatuses . When the status is set to VoxImplant.OperatorACDStatuses.Ready incoming calls will be distributed to this operator. We will have such a simple interface:

You can pull the finished application from GitHub . Just enter your account name (see ACCNAME variable).

PS This material does not specifically consider more complex scenarios, when there are several queues and skill groups, the ability to put a client in a queue and give him the opportunity to disconnect, in order to make a callback to the phone when the queue has come, etc. All this is really implemented within the framework of the VoxImplant functional.

PSS Reporting is an important part of the call center - it is also available both from the control panel and through the HTTP API. A few examples:
Example 1
Example 2
Example 3

Source: https://habr.com/ru/post/242397/


All Articles