-
-
Save anonymous/618480748988dd67c9de56902cd059d6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Net.httpRequest(url, function(e) { // запрашиваем свой бэкенд | |
if (e.code === 200) { // бэкенд случаем не лежит? | |
var resp = e.text ? JSON.parse(e.text) : {}; | |
if (resp.numberToCall) { // получили номер телефона водителя | |
// Собственно, маскировка номера: звоним от лица колл центра | |
var out = VoxEngine.callPSTN(resp.numberToCall, ACCESS_NUMBER); | |
out.addEventListener(CallEvents.Connected, function() { | |
// Дозвонились до водителя: синтезируем что-нибудь, | |
// соединяем с клиентом и так далее | |
}); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment