A Node.js telephony server app for Telegram that uses Node.js Asterisk Manager to simplify the missed calls processing. When there's a missed call Askozia sends a request to this application that is intercepted by Express and it triggers the bot to send a message to a specified chat. For my Bot I use Node Telegram bot Api.
First we get a request from Askozia of type http://ip:port/missed/phone number/time customer waited in seconds The following code proccesses this request:
app.get('/missed/:phone/:duration', function(req, res) {
// get phone and waiting time, send message with inline keyboard to telegram chat spesified in config.js
});
And that's what we get in Telegram:
The inline keyboard under the message represents operators' internal phone numbers. Clicking this button does not result in messages sent to the char rather it works as callback querry. The bot receives it:
bot.on('callback_query', function (msg) {
/* The json object we receive contains callback data from the button we click here: msg.data
Do your stuff */
});
Once a button has been clicked the phone call is initiated first to the operator:
When the operator picks up the phone, the call is redirected to the customer.
Fancy emojis make it more intuitive for operators :)
If a customer answered the call this is what we get:
In case an operator couldn't hit the "answer" button, the bot notifies the others:
Finally, in case a cusomer could bot answer for some reason and droped the call we get this:
...or if he didn't bother to pick up the phone:
All of the above makes the proccess of making return calls simplier more productive.