MarioSMS

SMS gateway

The system that moves messages between the internet and carrier networks, connecting an application's verification codes to the SMS world.

An SMS gateway translates between internet protocols and the signalling that carrier networks speak. When a platform sends your verification code, it hands the message to a gateway, which routes it hop by hop toward the destination carrier.

Route quality between gateways explains most delivery variance. The same service's code can arrive in five seconds over one route and never arrive over another.

What the connection looks like

Applications talk to a gateway over an HTTP API for simplicity, or over the older binary protocol built for messaging when they need throughput and delivery receipts at volume. The gateway then hands the message to an operator connection or to another intermediary.

A message often crosses two or three companies before it reaches the destination network, and each hop can add delay or drop it.

The receiving side

Renting a number puts you on the other end of that chain. The provider holds the line and passes anything it receives to your dashboard or to your code through the API.

Developers wiring this into a test suite usually poll for the code and release the number when done, which the Node.js guide shows in about thirty lines.

Why the same code takes a different time each attempt

Gateways pick a route per message, weighing price, current success rate and how the destination network is behaving. Two messages sent a minute apart can take different paths.

When the first path times out, a well-built sender retries down another. That retry is often what finally delivers, which is why the second attempt succeeds more often than patience with the first.