Those who were silent, stopped being silent. Those who have nothing to wait for, saddle up.

Three years ago, I couldn’t understand why patriotic education was happening through militarization: the “Young Army”, concerts with military themes, periodic exhibitions of military equipment. Why do the military get such cheap mortgages instead of scientists? Today, there are no more questions left, and the government’s course is finally clear to me.

I am very sorry that Russia does not have its own Elon Musks, Bill Gates, or Steve Jobs. Obviously, they won’t grow here for at least 50 years. Aggression, the desire to take everything away from a successful neighbor, envy, rudeness, the desire for a free ride, the desire to deceive a neighbor – all of this is not close to me and disgusting.

It is already clear to me that I will not see innovative developments, advanced technologies, and space exploration in Russia in my lifetime. These will be pathetic parodies like phones from China with Google OS and US hardware, piracy, and perhaps some clones of popular services that will always lag behind in technical implementation, will be contaminated with kickbacks and embezzlement.

I have no desire to participate in a company that replaces imported services that have left Russia. I have learned my lessons from the situation with Pavel Durov and VKontakte, Yevgeny Chichvarkin, and the Nginx project. I opened and closed an individual entrepreneur, knocked on the doors of the tax authorities and Roskomnadzor. That’s enough, thanks.

I have decided to invest in education in the near future and evacuate my family and children. So that the children grow up free, without insane censorship. So that they can calmly say that 2 * 2 = 4, and the setting is for creation and not destruction.

PS: Yes, I understand perfectly well that censorship exists everywhere to some extent, and I also understand that now there will be prejudice against Russians in many places. But I believe that children have more chances to grow up open to the whole world there than here.

Asterisk, ARI. Commute like a God

This small article will not cover anything about Asterisk dialplan. It will be about ARI – a flexible interface for Asterisk management.

As soon as Asterisk receives an invite and the call goes to our application (Stasis), we get the opportunity for low-level call construction.

Interaction with ARI occurs through receiving events via WebSocket from Asterisk, processing and creating new events through HTTP REST API towards ARI.

StasisStart

The event that our program receives when the channel enters the Stasis context is StasisStart. It can signal, for example, the start of an outbound or inbound call, as a result of which we launch low-level logic to create a channel towards another subscriber, add it to the bridge with the initiator channel, and make a call.

Simplified scenario of a regular call

  1. Received StasisStart event from ARI indicating channel A has been created.
  2. Created channel B with an endpoint towards a SIP peer, or a local proxy (example: SIP/MY_PEER/331234567890).
  3. Combined channel A from step 1 and channel B from step 2 into a bridge.
  4. Initiated a dial into channel B.
  5. Waited for the ARI ChannelStateChange event for channel B. And if the state is ‘Up’, launched an answer in channel A and the dialog begins.
  6. When receiving the ChannelHangupRequest event for either channel A or B, we terminate the call.

Call session

It may be necessary to store data about the call process, including CDR, for each channel.

As a storage solution, I would recommend using Redis, as high CPS and intensive database queries can create significant load on the hard drives and cause performance degradation.

Optimization

To ensure optimal operation of your ARI application under high CPS, I would recommend minimizing queries to the relational database. In my practice, I used queries only for minor limiting logic during call initialization and for recording CDR data after the call is completed. All other queries are performed in Redis.

I also recommend placing the your ARI application on the same host as Asterisk for infrastructure purposes in order to reduce latency.

Performance test

For testing, I used the console utility baresip, initiating a bash script to perform 200 calls to a pool of test numbers that answer with asterisk tt-monkeys.

200 parallel calls consumed about 5% of CPU load in total. All calls ended successfully, including recorded CDR data.

Debugging of a stasis application that signals answered calls.
SIP signaling

My GameDev comeback #3

My third appearance in GameDev turned out to be quite productive.

Once again, my nostalgia for a closed gaming project Rival Fire in which our clan fought hordes of monsters and won in 4×4 and 2×2 PvP competitions, led me to try writing a similar project from scratch.

I have long wanted to try my hand at creating gaming worlds. But reading literature and creating primitive prototypes did not satisfy me. Now, I am determined to create a working prototype of a multiplayer mobile game. The main resource is time, and there is never enough of it. Of course, after a successful experience, I plan to outsource the character models, weapons, and locations.

Game client

I decided to use the Unity 3D engine for the game client. To create a working prototype, I used free models that are available, so as not to burn out at the stage of graphic design. Although I have gained experience working in Blender over the past three years, rendering 3D models takes a lot of effort. So for now, the only graphic design I have is for the UI.

On alpha version i planed

  • The CO-OP level battle (up to four online players) will have waves where the player and their team will have to clear the location of various monsters (from flying to crawling) and fight a boss on the final wave.
  • PVP 1v1 battle on a mirrored arena.

Server

I have written the match server on Node.js. For client-server communication, I use web sockets and the JSON format. Each match instantiates a process that serves the game session for all match game clients on a specific network port. I have not yet determined if it is a good idea to use the TCP protocol instead of UDP. However, there were no issues during testing with two devices simultaneously

Currently, the server successfully spawns NPC monsters according to the scenario from the database for all game clients.

A big topic for discussion is the synchronization of positioning and actions of the player, especially in cases where packets are lost. It may occur that on the player’s client, the character is already at point C, while for everyone else (due to lost data), the character is at point B.

Game assets

I have decided to put in-game assets that may undergo frequent changes (characters, models, sounds, shooting logic) in an Asset Bundle and check for updates every time the game client is launched. This is usually done in modern games to avoid forcing users to constantly download the app from the market during hotfixes, and also to reduce the initial size of the game to prevent scaring off players.

Git repo

The game includes server and client code. Storing the server code is easy because it only takes up 4 megabytes, but it’s more difficult for the client. Raw textures for prebuilds take up about a gigabyte and will continue to grow. That’s why I decided to build my own Git server at home using a Raspberry Pi 4.

I purchased a Raspberry Pi 4 along with a casing, cooler, and a 512GB M.2 SSD, and I am transferring all the code locally to the Raspberry Pi.

Raspberry Pi 4 in an M.2 Argon case looks like a TV set-top box.

Case and ssd extension you can find out here: https://a.aliexpress.com/_9RbPFU

I also set up a copy of the server on it and am testing the entire gameplay process locally with two computers. I think later I will show how funny my tests look from the outside.

Stanford Graduate School of Business

Since I became a team leader of a large team, I am faced with many questions every day. How to effectively build a team that enjoys working and shows efficiency and productivity. How to engage the team, etc. Since I only worked on programming before and had no experience in management and team building, I periodically try to learn and fill in the gaps.

This program certainly opens up a lot of insights. I am lucky! I was able to meet Baba Shiv and other cool professors from Stanford, as well as talk to other CEOs and managers and find out what problems they face and how they solve them.

Pandemic as a test of IQ and whether or not to censor the Internet?

In the days when the internet had just received tools for communication between ordinary users (FIDO, ICQ, web forums), we discussed news, musicians, technologies, games online. A computer wasn’t available to everyone, and even fewer had a modem connection and a setup for communication. Therefore, there were practically no “lamers” online.

Since then, the internet has changed a lot. Politics has entered, and practically everyone today has a connection to the internet and the ability to change the world in a few clicks on a mobile phone screen.

Keep Reading

Gift from work

The package has arrived from the main office. Update!

Apple MacBook Pro 16 Touch Bar 2019 Silver MVVL2RU/A (16 “, 3072×1920 (8:5), Intel, Core i7, 16 Гб, SSD)

The most expensive computer I’ve ever owned in my life

My 2015 Macbook that I bought before moving to Sochi in 2016 from the Yahoo auction is no longer able to handle my work 😉

In short, I am very satisfied with the package! Working has become even more enjoyable now.

Assembling a 3x3x3 cube

Last week, due to having an excess of free time, I learned how to solve a cube. The video is old and accelerated. Now, I have a different sweatshirt and I am already much faster at solving it. ;D

We spend time in social distancing with benefit.

Gru


Here’s what 5G towers do. They make you bald. What will happen when they turn them on!