MarioSMS
How a One-Time Code Reaches Your Phone

How a One-Time Code Reaches Your Phone

By MarioSMS team · · 13 min read

Contents
  1. The four parties involved in every code
  2. Why A2P messages travel differently than person-to-person texts
  3. What you can and cannot observe from the receiving side
  4. What are sender IDs, routes and aggregators?
  5. Trace one code through the network step by step
  6. Why does delivery differ by service and by country?
  7. How do you debug a code that never arrives?
  8. Common questions about SMS one-time code delivery

You tap “Send code” and the phone stays quiet for a few seconds. In that gap, the message crosses four systems that never talk to you directly. The application generates the one-time code and hands the text to a messaging provider. That provider, the aggregator, chooses a delivery route. The route ends at a mobile carrier, which pushes the SMS to the handset over the signaling network. Each hop can queue the message, rewrite the sender, or drop it.

The path a one-time code takes

HopWho runs itWhat can go wrong
Your app or backendYouRate limits, validation, duplicate sends
SMS provider or aggregatorA vendorRoute choice, queueing
Wholesale routeCarriers between the two networksGray routes, silent drops
Destination carrierThe operatorSender filtering, spam rules
HandsetThe userPowered off, full inbox, roaming

The four parties involved in every code

PartyWhat it doesWhat it can break
ApplicationGenerates the OTP, sets expiry (often 60 to 300 seconds)Rate limits you, reuses a stale code
AggregatorPicks a route, formats the sender IDSends over a cheap route with poor delivery
CarrierDelivers to the SIM, applies spam filtersBlocks unknown senders, delays traffic
HandsetRenders the message, runs autofillSilences the thread, filters it to spam

Why A2P messages travel differently than person-to-person texts

A text from a friend starts on a SIM inside a carrier network and stays on carrier rails. An A2P message starts on a server, enters through an SMS gateway, and gets classified as commercial traffic before it reaches the destination network. Commercial traffic is registered, throttled and filtered. It is also priced per segment, which creates pressure to route it cheaply. Cheap routing is the most common reason a code arrives at 40 seconds instead of 4.

What you can and cannot observe from the receiving side

From the handset you see three things: whether a message arrived, what sender string it carries, and the timestamp. You cannot see which aggregator sent it, which route it took, or whether the carrier queued it for 20 seconds. Delivery receipts live on the sender’s side.

With a rented number the timer is explicit. MarioSMS numbers start at $0.04, hold one verification at a time, and show the code in the app or dashboard, usually inside a minute. If nothing lands before the activation window closes, the activation cancels and the price returns to your balance.

What are sender IDs, routes and aggregators?

Three names carry most of the confusion. The sender ID is what shows in the From field. The route is the commercial path the message takes between the sender and your carrier. The aggregator is the middleman that buys those paths in bulk and resells them per message.

Network equipment that carries messages between operators

Aggregators sit between application platforms and hundreds of operators, connected through the kind of equipment in the image above. One message may cross two or three of them before it reaches the network that serves your SIM. A delivery report travels back along that same chain, and each hop can rewrite it.

Sender ID types: alphanumeric, short code, long number

An alphanumeric sender ID shows a brand name and cannot receive replies. A short code is 4 to 6 digits, registered per country, usually high throughput. A long number looks like an ordinary mobile line and is the type rented numbers use.

How an aggregator picks a route and what least-cost routing changes

  1. The platform hands the message to its gateway with a destination prefix.
  2. The gateway ranks available routes by price, then by recent delivery rate.
  3. The cheapest acceptable route wins unless the sender paid for a direct one.
  4. If that route rejects or times out, the message retries on the next one down.

Least-cost routing pushes traffic toward whichever supplier is cheapest this hour. Direct routes go operator to operator. Gray routes reach the carrier through a side door, cost less, and get blocked without warning when the operator notices.

Where filtering and spam scoring happen

Filtering happens in at least three places. The sending platform blocks its own flagged accounts. The aggregator drops content that matches known spam patterns. The receiving carrier scores the message on sender reputation, content and volume, then delivers, delays or silently discards it.

Why a delivered status can be wrong

StatusWhat it meansWhat it does not mean
SubmittedThe gateway accepted the messageA carrier has seen it
SentIt left the aggregator toward a routeIt crossed into the carrier network
DeliveredA downstream party returned a success codeThe handset displayed it
FailedSome hop returned an errorThe number is invalid

On some routes that success value is generated before the handset is reached, and filtered messages can still be reported as delivered. Treat the receipt as a routing hint, not proof that a code landed.

Trace one code through the network step by step

A code that lands in three seconds and a code that never lands take the same path. The difference sits in which hop stalls or drops it. The table below names each hop, who operates it, and the failure mode that shows up there most often.

What a delivery report does and does not prove

StatusWhat it meansWhat it does not mean
AcceptedThe aggregator took the messageThe carrier will deliver it
SentIt left for the carrierThe handset received it
DeliveredThe carrier acknowledged deliveryThe user saw it, or the code is valid
FailedSomebody rejected itYou know which hop

[TABLE: The path a one-time code takes]

Steps 1 to 8, from API call to handset

  1. You tap send, the app posts to its own backend.
  2. The backend calls its SMS gateway or provider API.
  3. The provider picks a route for that country and sender ID.
  4. The message reaches an aggregator with local interconnects.
  5. The aggregator hands it to a carrier SMSC.
  6. The SMSC queues it against the subscriber record.
  7. The handset receives the message over the signaling channel.
  8. A delivery receipt walks back up the same chain.

Where the seconds actually go

Steps 1 through 4 are API calls between data centers and usually finish inside 500 milliseconds. Step 5 is the variable one. A busy SMSC can hold a message for 10 seconds, or several minutes if the handset is off-network.

[IMAGE: Typical timing of a one-time code]

Most codes clear the whole chain in 2 to 20 seconds. The long tail clusters on international routes, on numbers that recently changed carrier, and on handsets that just came back from airplane mode and are still re-registering.

What a retry looks like from the carrier side

When you press resend, the sending app generates a new code and submits a second message. The carrier sees two submissions to the same number, seconds apart, with near-identical text. Filters treat that pattern as spam-adjacent. Three rapid retries can get your number throttled for 10 to 30 minutes on that route.

Wait 60 seconds between retries. If the first message was queued rather than dropped, it often arrives during that wait.

How a rented number receives the same message

A rented number sits on a real SIM inside a carrier network, so steps 5 through 7 are identical to your own phone. The difference is step 8 and after. Instead of a lock screen, the message lands in a dashboard.

With MarioSMS, you rent a number for one verification at a time, starting at $0.04. The code appears in the app or at app.mariosms.com, usually within a minute. If no SMS arrives before the activation window closes, the activation cancels and the price returns to your balance automatically.

Why does delivery differ by service and by country?

The same app can deliver a code in 6 seconds in one country and time out in another. The message content is identical. What changes is the set of rules the message has to pass on the way in.

Typical timing of a one-time code

Sender registration and per-country rules

Several countries require the sender to register before any A2P traffic is accepted. Registration covers the company, the sample message templates and the sender ID string. Unregistered traffic gets filtered, rewritten to a generic number or dropped without a delivery report, so a service that works everywhere in Europe can fail in one market until its paperwork clears.

Other rules stack on top. Some regulators block alphanumeric sender IDs and force a numeric sender. Some require local-format numbers. Some prohibit URLs inside the message body, which matters when an app sends a magic link instead of a 6-digit code.

Services that send from short codes versus long numbers

Sender typeTypical useBehaviour you notice
Short code (5 to 6 digits)High-volume OTP in one countryFast, consistent, single country only
Long virtual numberCross-border OTP and repliesWorks widely, slower when routed far
Alphanumeric IDBranded notificationsBlocked or rewritten in some countries

Short codes are leased per country and per carrier, so a service using them at home falls back to a long number abroad. That fallback path crosses more hops, and each hop adds queueing time.

Country mix, stock and price variation

Numbers are inventory. Ranges get used, flagged and retired, and operators release new blocks at different rates. A country with fresh ranges and easy sender rules costs less to serve than one where clean numbers are scarce. MarioSMS prices start at $0.04 per number and vary by service and country for that reason, across 35+ countries and hundreds of services in stock.

Testing the same flow across 35+ countries

  1. Pick one service and rent a number in country A.
  2. Record the time from send to code appearing in the dashboard.
  3. Repeat in countries B and C, same service, same hour.
  4. Compare arrival times and cancellation rate per country.
  5. Automate the loop through the REST API in Python, Node.js, Go or PHP.

Each number covers one activation. If nothing arrives before the timer ends, the activation cancels and the price returns to your balance, so a failed country test costs time, not money.

How do you debug a code that never arrives?

A missing code has three possible homes: the sender, the route, or the receiver. Work through them in that order, because sender-side problems are the most common and the cheapest to check.

Check the sender side first

  1. Confirm the service accepted your number format, including country code and no spaces.
  2. Check whether the service showed a “code sent” state or an error banner.
  3. Wait 60 seconds before requesting a resend, since many platforms queue a second request behind the first.
  4. Count how many resends you have triggered. Some services rate limit after 3 attempts per hour and silently drop the rest.
  5. Check whether the service supports SMS for your selected country at all.

If the service never handed the message to its SMS gateway, nothing downstream matters.

Rule out the route and the filter

Carrier filters drop messages that look like spam, usually without telling the sender. A message can be accepted by the aggregator, marked as sent, and still never reach a handset. Signs of filtering: the same service delivers fine in one country and fails in another, or codes arrive for some prefixes and not others.

SymptomLikely causeNext move
No code, any countrySender rejected the numberRe-check format and service support
Code in country A, silence in BRoute or filter in BSwitch country
Code arrives 5 to 15 minutes lateQueue backlog or retryWait out the timer
First code works, second never comesSender rate limitWait an hour

Rule out the handset and the number

On a rented number the handset is not yours, so the receiver side reduces to one question: did the platform log an inbound message. Refresh the dashboard, check the app and the web app at app.mariosms.com, and confirm you are looking at the correct activation rather than an older one.

When to cancel and start a new activation

Cancel once the timer has less than 30 seconds left and no message has landed. The price returns to your balance automatically. Then rent a fresh number, ideally in a different country, and send one request instead of three.

Common questions about SMS one-time code delivery

How long should a one-time code take to arrive?

Most codes land in under a minute. Anything past 90 seconds usually means a queue, a filter or a retry, not a lost message.

Can two services share the same sender ID?

Yes. Alphanumeric sender IDs are not globally unique in every country, so two apps can both show up as “VERIFY”. Read the message body, not the header.

Does a delivery report mean the user saw the code?

No. A delivery report confirms the handset accepted the message. It says nothing about whether anyone read the screen.

Why do some codes arrive out of order?

Separate messages take separate routes and retry paths. Request three codes in 20 seconds and the third can land first. Match each code to its request before you use the newest one.

What happens if no SMS arrives on a rented number?

The activation timer expires, the rental cancels, and the price returns to your balance. You pay nothing for a silent number. Rent a fresh one, ideally in another country, and send a single request.

Can I receive codes through an API instead of a dashboard?

Yes. The REST API returns the code as JSON, with examples in Python, Node.js, Go and PHP. See receiving SMS in Python for a working loop.

What uses of a rented number are acceptable?

Privacy hygiene, second accounts for legitimate reasons, and QA or OTP testing. Never ban evasion or impersonation. The full list is on the acceptable use page.