📜 ⬆️ ⬇️

Development: New Generation Messenger (Part 2)

Continued ( Part 1 ), Part 3.



Messenger Functionality for Android and iOS


No phone number is used for registration


When developing the messenger registration process, it became clear that the phone number as an identifier is not needed at all and even hinders.
This is about the same as for some device to support Morse code, that is, an anachronism in its pure form.

Surprisingly, many messengers stubbornly continue to register by phone number - apparently getting information about the owner is so important that they put up with the following problems:

No guaranteed SMS delivery for all operators


The percentage of successful receiving SMS on average is 60-70% and this is not surprising, since there are hundreds of countries, and in each country there are several operators and it is rather difficult to ensure the efficiency of each route.

All large SMS aggregators (for example, Nexmo) do not guarantee delivery at all, and in countries such as Afghanistan, for example, it is impossible to send SMS to some operators. For each operator, Nexmo has several routes and sometimes whole directions for this aggregator do not work for weeks.

SMS sending is expensive


Everyone remembers a case that happened not so long ago - WhatsApp blocking in Brazil.
What happened then - millions of Brazilians began to register in other messengers - for example, TG said that it received millions of new users in this country.

But not everyone knows that sending an SMS with a confirmation code to Brazil costs 10-12 cents on average.

Let's calculate, let’s say that it has been registered 2 million - 10 cents * 2 million = 200 000 USD.
Those. 200 000 USD was thrown out for one day irrevocably.

Why permanently? Because in a day WhatsApp was unblocked and users left with TG.

Why am I telling all this?

It seems to me that this is a reason to think - why are some instant messengers, despite the fact that it is inconvenient and expensive for them, persistently continue to demand telephone numbers from users?

So, the messenger does not require the owner's phone number, all you need is to create a login that is checked for uniqueness and a password.

When registering, email is asked only so that you can recover your password. Those. If you enter an incorrect email or do not confirm it, registration will still occur, only you will not be able to recover the password if you have forgotten it.

The messenger does not require access to your address book.


Unfortunately, almost all popular instant messengers require access to your phone book, one of your phone number is not enough for them.

And people do not realize how dangerous this can be.

Of course, on the one hand, it is very convenient - one day to get a notification that Plumber Petrovich also joined WhatsApp, Viber, etc., despite the fact that you spoke with him a couple of times more than a year ago.

But the recent HYIP around the GetContact application shows that not everything is so simple - more than 2 billion numbers have already been merged, and the numbers of those who have not even installed this application have been merged.
Imagine that all popular messengers know the numbers of your friends, acquaintances, relatives and this information is constantly updated. You can build intersections, do analytics, target, etc.

Standard encryption


The messenger uses the standard TLS / SRTP encryption protocol. Everything is encrypted, including audio and video calls.

As a simple independent audit, you can do the following - connect a gateway or IP phone in parallel to your account that can encrypt via TLS / SRTP and enable this feature — the server will understand and pick up encryption.

Safety and privacy


In our opinion, the messenger turned out to be more secure than other advertised messengers, mainly due to the simple reason that we do not require a number and do not require access to the notebook.

Even if we imagine a hypothetical case that the MITM attack succeeded and managed to decipher the messages, it will be completely incomprehensible to whom the correspondence belongs because there is no most important thing - the telephone number and the sides of communication cannot be identified.

Communication only after approval of the request


The messenger can not communicate with the user without sending a request to start communication and without obtaining permission from the other party.

Spam protection.

Standard features




All the standard functions are implemented in messengers:

- text chat
- send audio messages
- sending files
- location sharing
- audio / video calls
- group chats without limiting the number of participants

Auto Delete Messages




In chat rooms, you can enable auto-deletion of a message after a specified period of time has passed.

Remote location request




A user in a particular chat can turn on permission to request a geolocation from another chat participant.

As a result, the other party can receive information about the location of the interlocutor independently at any time when this function is activated.

It may be useful to control the location of children, elderly relatives, etc.

Users near




The Users beside function shows the distance to those users who also enabled this mode. The distance is limited to 100 km.

When you turn off this mode, you become invisible, but you do not see other users.

Push-to-talk mode (push to talk, walkie talkie, walkie talkie)




Real-time PTT - radio mode is implemented in the messenger.
The mode works if enabled for each chat participant.
Also works in group chats. If in the group chat someone does not have this mode, then he simply does not hear such messages.

The number of participants in the group with a walkie-talkie is not limited.
You can set the night mode — that is, set a period of time in which Walkie-Talkie messages will not be heard (for example, at night).

Live TV mode




The Live TV feature allows you to turn a user's smartphone into a video camera.
You can enable this mode both for any user of the messenger and for a specific group.

Allows you to quickly organize video surveillance of the office, apartment, cottage, cars, etc.

SIP integration




SIP in the messenger is supported in two modes - SIP Trunk and SIP client.

SIP Trunk mode


Allows you to connect to a registered account in parallel any IP phone, VOIP gateway or trunk from any IP PBX (virtual, on Asterisk, etc.)

In the appropriate section SIP equpment of any account are data to connect.
If you connect an IP phone, then when you call from the messenger user there will be a call to both the application and the IP phone.

With the application, you can make an intercom call that will establish the connection between the IP phone and the application.

In the case of connecting a trunk from a VOIP PBX, the call will arrive respectively on the trunk of the PBX, i.e., you can make calls to any PBX from the messenger ecosystem and process them as if the DID connection was made.

The number of simultaneous calls is not limited.

SIP client with push notification




SIP client mode is designed respectively for registering the messenger as a client, similarly to such applications as Csimple, Linphone, etc.

But unlike these clients, the messenger can work in sleep mode and, accordingly, has very low consumption while waiting.

As it is known, the problem of all SIP clients is that they must periodically maintain registration with the SIP registration server, which means sending registration packets periodically. As a result, these customers can not go into standby mode and are always online, which discharges the smartphone battery. As a result, most users use such clients only for outgoing calls.

Our SIP client is deprived of this drawback - when an incoming call comes, a push notification arrives, which “wakes up” the application and only then does the launch occur.

Those. Now, if someone uses DID numbers with SIP registration, he can receive incoming calls to these numbers in the sleep mode of the smartphone.

Up to 8 simultaneous SIP registrations are supported.

It can be useful both for individuals who use VOIP providers for making inexpensive calls, and for business - you can bring the internal number of the office PBX to the instant messenger and not be afraid that such a mode will discharge the battery.

Also found an interesting opportunity to work in this mode - the work of one SIP account, one account simultaneously on different devices.

At the same time, if an incoming call comes to a SIP number, then all the phones ring at once.
It may be useful for those who want to save, to take, for example, a paid account with one provider and scatter for several people.

Or, for example, take one number for incoming calls and scatter it to several people at once (employees, relatives, etc.).

It is done this way - we register once, i.e. we get only one login.

Next, we register with the SIP provider, get an account, register it in the messenger.
Further, other users download the messenger and log in with the same login, since the messenger supports simultaneous work with one login from several devices.
Now you can make calls under one SIP account and receive calls to one SIP number at the same time.

The number of users is almost unlimited.

Amazon Alexa Echo Integration




We also integrated Alex's bot from Amazon into the messenger.

As a result, almost all of Alex's skills are now available to messenger users.
At the initial entry into this mode, you will need to either enter an existing login for Amazon or create a new one.

With the help of Alex, you can find out the weather, time, order a taxi (Uber), pizza, make purchases on Amazon and much more - about 20,000 skills are available.

But the most important thing is that you can control smart sockets, lamps, switches, thermostats, smart locks and even cars with your voice.

Every day there is an increasing number of devices that support Alex, ranging from cheap switches from Sonoff for $ 5 and ending with Fitbit bracelets.

We implemented integration with Alexa Echo in three modes:

- Voice control

Everything is clear here - we press the button, we say, the devices are turned on, or questions are being answered, etc.

- Execution of text commands

Analogue of the messenger - we write in the line questions or commands to Alex, they are executed.
Convenient when you need to keep quiet.

- Execution of predefined patterns of commands on tapu on buttons



In this case, buttons with pre-programmed commands (which are often executed) are created and then pressing them to execute them - like a remote control.
Such a remote control works naturally without a limit on the distance; you can control a house thousands of kilometers away.
It is useful then when it is necessary to observe silence and at the same time laziness or inconvenient to write text.

API for Alexa

We went further and implemented a simple API in order to be able to control all devices and generally Alexa from other devices — from Arduino, from another messenger — through the included instant messenger.
In this case, you just need to run certain json commands.

Bots




In the messenger ecosystem, you can create bots.

Bots are of two types:

Standard bots

They can be created by any user using the API.
In the search bar, such bots are no different from ordinary users.

Business bots

They differ in that the name of such a bot begins with an ampersand @ and when added, they fall into a specific section and are not mixed in the general list with regular users.
Only we can create such bots and they are official bots.
This also achieves cybersquatting protection for official bots.

Business accounts



Business accounts are a collection of three entities:

1. The official business page
2. The official bot of the company (starting from the bot-business card to a simple online store)
3. Integration with IP PBX companies - the ability for the average user to make direct audio / video calls to the support, technical support, etc.

Business accounts in the names have an ampersand sign @ and also fall into a separate section in the messenger and are created only by the administration.

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