📜 ⬆️ ⬇️

How we taught 1C to generate an IVR menu for Asterisk

In recent years, IP telephony has entered the business by leaps and bounds. Every day there are more and more opportunities. Employees can work not only in the office, but in general, anywhere in the world. In order to connect telephony to an employee, just a few clicks, no wires, and separate outlets. Companies use call recording, telephony integration with CRM systems. Every self-respecting company connects a multichannel number or even pays for every customer call using the number 8,800.

Giving a client your cell phone becomes a bad tone, because the client's request must be registered with CRM and guaranteed to be processed. Each employee is assigned an internal extension number, and most often, knowing the extension number, you can quickly contact the right person. The PBX knows where the employee is now, and will be able to connect the client with the desired IP phone in the office or a mobile phone, or even a SIP softphone installed on a laptop or smartphone.

But progress has another side. Multichannel number becomes like a firewall. It protects employees within the company from customer calls. An IVR menu appears on the client’s path, or even a multi-level IVR menu, and just don’t say that my call is very important to you :)

Life story


An unpleasant story happened to me. In one of the large banks, the issue of a single deal was resolved, and I had to go on foot to visit several branches in ascending order, until I found the right specialist. My dear girl solved a lot of my questions, having spent 4 hours on it, during which we did some documents, scanned my contracts, signed some papers. I thought that the issue was finally resolved, but the next day a call came to me, and the cute girl asked for some additional information. And after 2 weeks of the deal came a refusal from the bank. Oh, how I wanted to call back this girl and find out what exactly is the matter and how to proceed.

First, I found a cell phone from which she called back, but the phone is not serviced. Probably, it is only for outgoing. Then I went to the site, but there was only one number 8800. One number for the whole of Russia !!! Of course, I called and listened many times about new credit cards, about deposits, a bunch of some other advertising, but for 40 minutes I could not get on a living person. Yes, and he doubted that they would be able to connect me with K. Ivanova (it was so written in the signature that the copy is correct for one of the documents)
And I had to go to the other end of Moscow to find out the internal phone number of the girl who worked until 15.00 today.
')
And here in my head there were 2 ideas.





We have been engaged in the integration of 1C and telephony for many years, and we had a solution for routing the call to the responsible manager. But it was awkward. The manager was chosen in the client’s card, and in real life, different employees often worked with the client. Responsible should be assigned automatically and change with the development of relations between the company and the client.

Figa main module on 1C



On the example of my communication with the bank, we began to develop the system from the event analysis module in 1C: CRM. In 1C all contacts with the client are registered, bills and financial documents are written out, electronic correspondence and telephone conversations are stored. Therefore, to begin with, we must select those events that matter to us.



It is clear that each event in CRM has its own weight and expiration date. If I just billed you and sent it by e-mail, and after an hour you call back, then surely me. And if I wrote you an invoice a month ago, and today you corresponded with the guys from support, and specialist Vanya called you several times, then your new call is definitely not for me, but for specialist Vanya.

Each client has its own 1C, and it seems to me that it is the most difficult to configure the event types, weights and expiration correctly.



After setting the list of recorded events, a continuous analysis of the base 1C of the scheduled task begins. The 1C: Enterprise server copes well with this task.


In order for the 1C server not to do preliminary calculations at the time of the call, in the second table a rating is made up of the staff and phone numbers of our clients. The rating is constantly recalculated after creating a new significant event.



When an IPMATIKA customer calls from the number +7 (495) 926-26-44, then with great probability they will need Yevgeny Chulkov , well, if there is none, then Maslennikov Dmitry will be able to support the conversation.

At this point, I realized that blind forwarding to a responsible person is not the best choice. Why not suggest that the client specify the right employee for himself, and in terms of call routing, this is a simpler solution. We do not touch the standard routing scenarios, but use prompts in the form of a personal IVR menu .

We have to make a voice greeting from pre-prepared phrases, generate an audio file, play a new IVR menu for the client. The algorithm of the solution should be approximately like this.



We chose two TTS solutions as a speech synthesis service. Conditionally free
Speech Kit from Yandex and
VoiceFabric from the Speech Technology Center.
To get started, you need to get the API key from one of the services and enter it in the form of settings.



I really liked the generation of speech from the company MDGs, but it is paid and is quite expensive for mass generation, so we came up with local cache technology. When the maximum quality mode is set, the voice menu is generated from the full sentences, and when the maximum economy mode is enabled, we request the generation of individual words.

You can set the fixed parts of the voice menu, for example, the beginning and the end of ours looks like this:


When generating, a list of 2-3 suitable employees is inserted between them:



If in 1C there is no information about the relationship with the client, IVR is generated by default.

MIKO: Intelligent Call Routing - Default Hello


On the side of 1C, there is quite a bit left - to do filtering by dismissed employees, technical accounts (Robot, Administrator). In an amicable way, you still need to clean up those who are on vacation, but we have not done it yet.



It would also be good to advance in advance the full name, especially those that obey non-standard rules (White, Black, Twisted ...)

The second part we write on AGI in Asterisk



As an Asterisk server, we have been using a paid build for a long time.
Askozia , on the one hand, it is very easy to set up, on the other - according to the possibilities of customization, it is not inferior to many free solutions, and I like it, it is difficult to explain :)

When developing the Asterisk module, there is an important condition: “Never interrupt call processing ”. Even if 1C stops responding, calls should go. We need a guaranteed backup route to the sales department.

All the logic of work on the Asterisk side will be performed using AGI and AMI technologies. How to create applications for the integration of 1C and AGI we wrote a few years ago in this post .
The application on the Asterisk side performs the following tasks:


Add a PHP application directly in the Web interface and copy the ID of the new application.



We create the simplest IVR route to which we will direct all customer calls. We define a backup route in case something breaks in the AGI script. On our server, I simply indicated the phone number of our sales department (90) and the ID of the newly created AGI script.



As a result, when you call our company, you will hear something like this:




Free Yandex, wave suitable for debugging. The speech from the Speech Technology Center is much cooler, and we use it on the battle server.

Total



We implemented the IVR menu generation module 3 months ago. During this time, the number of customer redirections between employees has sharply decreased.

The new IVR menu has a multiple WOW effect. We specifically added a phrase about CRM to the menu, many are interested in how it works =)

The generation rate of a completely new IVR menu does not exceed 1-3 seconds, if the necessary phrases are not yet in the cache, and a fraction of seconds, if the necessary phrases have already been synthesized earlier. In fact, now we receive new phrases only when a new employee appears in the company. The rest of the time, the system works autonomously and independently of TTS servers.

Thank you very much if you could finish reading to the end. I am pleased to answer all questions.

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


All Articles