KenyaSMS
API & Developer Tutorials 5 min read

SMS Gateway for Safaricom, Airtel & Telkom: How Routing Works

Understand how SMS routing works across Kenya's three mobile networks. Learn the difference between direct routes and grey routes, why it matters for delivery rates, and how KenyaSMS ensures your messages arrive.

What Is an SMS Gateway?

When you send a bulk SMS campaign, your message does not magically appear on your customer's phone. It travels through a series of systems — from your application, through an SMS gateway, across telecommunications infrastructure, and finally to the recipient's handset. Understanding this journey is critical if you want reliable delivery in Kenya.

An SMS gateway is the bridge between the internet (where your application lives) and the mobile networks (where your customers' phones live). It translates your API request into the SMPP (Short Message Peer-to-Peer) protocol that telecommunications networks understand, then routes your message to the correct network — Safaricom, Airtel, or Telkom.

Kenya's Three Mobile Networks

Kenya has three primary mobile network operators, each with distinct network prefixes:

NetworkCommon PrefixesMarket Share (approx.)
Safaricom0701-0729, 0740-0743, 0745-0746, 0748, 0757-0759, 0768-0769, 0790-0799, 0110-0115~65%
Airtel0730-0739, 0750-0756, 0780-0789, 0100-0108~27%
Telkom0770-0779~8%

When you send a message to 0712345678, the gateway needs to identify this as a Safaricom number and route the message through the correct connection. This prefix-based routing happens in milliseconds.

Direct Routes vs Grey Routes

This is where SMS quality diverges dramatically between providers. There are two fundamentally different ways to deliver your message:

Direct Routes (What KenyaSMS Uses)

A direct route means the SMS gateway has a direct SMPP connection to the mobile network operator. Your message travels the shortest possible path:

Your App → KenyaSMS Gateway → Safaricom/Airtel/Telkom SMSC → Recipient's Phone

Benefits of direct routes:

  • Speed — messages typically deliver in 1-5 seconds
  • Reliability — 99.5% delivery rate because there are no intermediate hops that can fail
  • Sender ID preservation — your registered sender ID (e.g., "MYSHOP") appears correctly on the recipient's phone
  • Accurate delivery reports — you get genuine DLRs (delivery reports) directly from the network
  • Compliance — direct routes comply with CAK (Communications Authority of Kenya) regulations

Grey Routes (What Cheap Providers Use)

A grey route sends your message through international networks to avoid paying local termination fees. The path looks like this:

Your App → Provider Gateway → International Hub (e.g., Europe/Asia) → Foreign Carrier → Kenya Network → Recipient's Phone

This is cheaper for the provider, which is why some bulk SMS companies in Kenya can offer rates below KES 0.30 per SMS. But the hidden costs are severe:

  • Slow delivery — messages can take 30 seconds to several minutes, sometimes hours
  • Low delivery rate — as low as 60-70% because international hops frequently fail
  • Sender ID stripping — your brand name gets replaced with a random number or "Unknown"
  • Fake delivery reports — the international hub reports "delivered" even when the message was dropped
  • Regulatory risk — grey routes violate CAK regulations and can result in fines for your business

How to Identify Grey Routes

If you suspect your current SMS provider is using grey routes, here are red flags to watch for:

  1. Pricing seems too good to be true — if they charge below KES 0.30 per SMS, they are almost certainly using grey routes. Direct Safaricom termination alone costs more than that.
  2. Sender ID does not work — you register a sender ID but recipients see a phone number instead.
  3. Delivery reports are suspiciously perfect — 100% delivery rate? That is a red flag. Even the best networks have some undeliverable numbers (switched off, out of coverage, invalid numbers).
  4. Messages arrive late — if OTPs arrive 2-3 minutes after sending, your provider is routing internationally.
  5. Messages fail on specific networks — grey routes often work for Safaricom but fail on Airtel or Telkom because the international carrier does not have agreements with all Kenyan operators.

The KenyaSMS Routing Architecture

At KenyaSMS, we maintain direct SMPP connections to all three Kenyan mobile networks. Here is how our routing works:

  1. Number validation — we check the recipient number format and identify the network from the prefix
  2. Route selection — based on the identified network, we route through the appropriate direct connection
  3. Load balancing — for high-volume campaigns, we distribute messages across multiple SMPP binds to maintain throughput without congestion
  4. Failover — if a primary route experiences issues, we automatically switch to backup connections
  5. DLR tracking — we receive genuine delivery receipts from the network and pass them through to your application via webhooks

Our infrastructure, hosted in Nairobi, processes over 2 million messages per day with an average delivery time of under 3 seconds across all three networks.

Why Routing Matters for Your Business

Consider a practical example: a Nairobi restaurant sends a lunch special promotion to 5,000 customers at 11:00 AM. On direct routes, all 5,000 messages arrive within 2 minutes — in time for the lunch rush. On grey routes, messages trickle in over 30 minutes, and 30% never arrive at all. The restaurant paid for 5,000 SMS but only 3,500 were delivered. That is money wasted and customers lost.

For time-critical use cases like OTPs, the difference is even starker. A customer trying to complete an M-Pesa payment on your platform needs that verification code now, not in 3 minutes. Every second of delay increases cart abandonment.

Test Your Current Provider

Here is a simple test you can run today. Send a test message to three phones — one on each network (Safaricom, Airtel, Telkom). Record:

  • How long each message takes to arrive
  • Whether your sender ID appears correctly
  • Whether the message arrives at all on each network

If any message takes more than 10 seconds, your sender ID is missing, or Airtel/Telkom messages fail — your provider is likely using grey routes.

Switch to KenyaSMS for direct routes to all Kenyan networks, genuine delivery reports, and the reliability your business deserves. Trusted by 10,000+ Kenyan businesses with a 99.5% delivery rate.

Ready to Start Sending SMS?

Join thousands of Kenyan businesses using KenyaSMS. Get 10 free credits on signup.

System Administrator
KenyaSMS Team

Related Articles

Ready to Start Sending SMS?

Join thousands of Kenyan businesses using KenyaSMS. Get 10 free SMS credits when you sign up.