An article from the heading "Ov. Smart hands."
Today we will tell how using 7 plastic bottles, scotch tape, one programmer and VoxImplant service to make your own “Callback” service (also known as car call center, callback, leadback, etc.). We call it "Secretary".

Some theory
In a nutshell, I remind you what it is and how useful it is for websites. This is a phone icon, which is a dynamic call order form. Dynamic, because it is present on the site during the entire session of the visitor and can be located anywhere in the browser - top, bottom, left, right. If you click on the icon, a form pops up with a call to leave a phone number and promise to call back in the near future (in 15-30 seconds). After the visitor has left his phone number, the service automatically and almost instantly connects your operator and call customer.
')
It can look different. Below are several versions that we have implemented for our customers.


In general, a convenient, useful, and mega-popular service (according to my subjective calculations, there are now more than 100 clones of the same type on the market that compete only in the marketing packaging of a product).
Some of our statistics
On the site with a traffic of about 4,500 people a day, our “Secretary” attracts an average of 2,230 minutes of calls per month. What is more than 1.5 days of pure time. The average duration of a conversation is 4 minutes, that is, 500-600 calls per month.
Parameters and values:
1. Attendance - 4500 per day
2. Total time - 2230 minutes per month
3. Wed duration - 4 minutes
4. Wed number of leads (calls) - 550
The results speak for themselves. And to recommend this service to use nothing bothers me.
Some practice
Now that we have remembered what this service is, what it is for, and gave examples of its practical benefits, we suggest that we start assembling “our” designer.
We will need:• Designer, 1 person. He should draw a widget that you will use on your site. Cost: from 1000 rubles to 10,000 rubles, depending on which specialist you take.
• Layout designer, 1 person. He should roll up the painted widget. The cost ranges from 1000 rubles to 15,000, depending on the complexity of the display algorithms, the adaptability of the widget for different devices and the number of browsers your tool supports.
• Programmer, 1 person. Most often this is the same typesetter who has to hang up the call to the autodial function on the desired button. Cost from 3000 to 10000. Again, it depends on the complexity of implementation.
I will not dwell on the item “how to draw and make a widget”. It seems to me that this question will not cause difficulties. We now turn immediately to how all the autodialer mechanics are implemented.
I met several solutions to this issue:
• Using cloud PBX + API
• Using CRM functionality
• With Asterisk
• With VoxImplant
We will consider a variant with VoxImplant. The remaining options, I suspect, is not much more difficult. Immediately, I’ll make a reservation that the purpose of this article is to show the simplest example of autodial, but nothing will stop you from completing something more complicated with the help of api voximplant.
So:
1. We register in the service VoxImplant
2. In the "Users" section we create a user that will be required for authorization in the application.
3. In the section "Scripts" create a script. This is the code that will be executed on the voximplant side when making a call.
An API description can be found at
voximplant.com/docs/references/appengine/VoxEngine.htmlHere is a small example of such a scenario:
var call1, call2, phone; VoxEngine.addEventListener(AppEvents.Started, handleScenarioStart); VoxEngine.addEventListener(AppEvents.HttpRequest, handleHttpRequest); function handleHttpRequest(e) { // Handle HTTP request sent using media_session_access_url VoxEngine.terminate(); } function handleScenarioStart(e) { // Data can be passed to scenario using customData // script_custom_data param in StartScenarios HTTP request will be available to scenario as customData // in this scenario we will pass phone string via script_custom_data phone = VoxEngine.customData(); // start scenario - calling number 1 call1 = VoxEngine.callPSTN(phone, '74991112233'); // Office phone // assign event handlers call1.addEventListener(CallEvents.Connected, handleCall1Connected); call1.addEventListener(CallEvents.Failed, handleCall1Failed); call1.addEventListener(CallEvents.Disconnected, handleCall1Disconnected); } function handleCall1Failed(e) { // Fail handler } function handleCall1Disconnected(e) { // Disconnect handler VoxEngine.terminate(); } function handleCall1Connected(e) { // first call connected successfully, play message call1.say("", Language.RU_RUSSIAN_FEMALE); call1.addEventListener(CallEvents.PlaybackFinished, function(e1) { // after message played - calling number 2 call2 = VoxEngine.callPSTN(phone, '74991112233'); // assign event handlers call2.addEventListener(CallEvents.Connected, handleCall2Connected); call2.addEventListener(CallEvents.Failed, function(e2) { call1.say(" ", Language.RU_RUSSIAN_FEMALE); call1.addEventListener(CallEvents.PlaybackFinished, function(e3) { VoxEngine.terminate(); }); }); call2.addEventListener(CallEvents.Disconnected, function(e2) { VoxEngine.terminate(); }); }); } function handleCall2Connected(e) { // connect two calls with each other - media VoxEngine.sendMediaBetween(call1, call2); // and signalling VoxEngine.easyProcess(call1, call2); }
4. In the "Applications" section we create an application to which we bind the created user. The same create a rule in which the script written by us is executed.
5. If necessary, buy a number that will call you and your customers. Theoretically, for each scenario you can set up a separate number.
6. Returning to our widget widget. When making a call, for example, when you click the “Order a call” button, you need to call your own function that will send a request to the API. Suppose it is called makeCall (phone). The makeCall function should call the StartScenarios method, to which you want to pass:
• account_id (on the
manage.voximplant.com/#apiaccess page),
• rule_id (rule number),
• api_key,
• phone (value of our client’s number. This parameter is set in script_custom_data)
Description of the StartScenarios method -
voximplant.com/docs/references/httpapi/StartScenarios.htmlVoila, a simple version of auto dialing is ready. If desired, it can be developed further, as your heart desires. For example, dial up to the client only if your call center responded and pressed the connect button. Or go through several numbers of your managers and choose the one that is free.
Some text in small print
Now we will talk about what should be considered at launch, when everything will be ready for it.
1. Work your call center.
Check that your call center has the ability to quickly respond to incoming requests. After all, the reaction rate is half the success. It is optimal to buy a dedicated number from VoxImplant, as well as to allocate a number on your side and receive these calls “past” the answering machine. Thereby, fulfilling the promise to call back in 25 seconds. Otherwise, you see, it will look strange if your client picks up the phone hoping to get an answer to the question, and instead hear: "Stay on the line, your call is very important to us." Accordingly, solve this issue either programmatically or organizationally.

2. Night time.
If you do not have a 24-hour call center, this should be taken into account. Or just turn off the form at the end of the day, or change the text to "We will call you back in the morning." In any case, this is a simple task for your coder.
3. Mobile version.
Above this, you should seriously consider. Do you have an adaptive layout of the site for mobile traffic? If there is, then it’s necessary to take this into account in the layout specification. If not, it’s better not to use the tool at all on mobile traffic. You will not lose much, but at the same time people will not be dissatisfied. In any case, this issue is solved with the designer and coder at the stage of drawing the widget.
A little about money
The budget of the event is quite trivial! A minute of conversation will cost from 1.6 cents per minute for urban lines to 2.6 cents for mobile. For two lines, a call will cost you 3.5 rubles on average.
Integration does not cost anything at all, except for the cost of the programmer.
Dedicated number - $ 4.6975 per month.
Total average expenses on average:1. Designer - 6 000 rubles
2. Maker-up programmer - 12 000 rubles
3. Dedicated number - 300 rubles.
4. Total *: 18 300 rubles
* costs can be half as much or zero if you have the necessary staff on staff.That's all simple manipulations, thanks to which you have your own callback service. More precisely, only part of it. The fact is that many “trapping leads” algorithms are based on a more intelligent or just a technically more complex model. And take into account many factors - when, to whom and taking into account what conditions are forced to call the callback form, so as not to annoy visitors and at the same time increase the number of calls, time for receiving calls by day of the week, the ability to exclude specific phone numbers and so on. All this also gives an additional effect. But this is a topic for a separate article.
I can recommend to representatives of online stores to familiarize myself with my
article about Smart Offer - another one of our services, whose presence on the website guarantees high performance, especially if used in tandem with Secretary. At the same time, the display of the “Smart-offer” is blocked when the visitor fills out the “Secretary” form. This ensures maximum loyalty to your visitors.

PS You ask why 7 plastic bottles and scotch?
Scotch - so that the programmer is not bored. Better 12 year old to take. And 7 plastic bottles were not useful. Additional savings are obtained.