Skip to content

FSerg/askozia-telegram-reminder-v2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Asterisk Telegram Bot

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.

How it all works:

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:
1

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:
3

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:
4

In case an operator couldn't hit the "answer" button, the bot notifies the others:
2

Finally, in case a cusomer could bot answer for some reason and droped the call we get this:
5

...or if he didn't bother to pick up the phone:
6

All of the above makes the proccess of making return calls simplier more productive.

About

Telegram-bot - reminder of missed calls for Askozia

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published