How to Avoid Losing Transactional SMS: SMSC Integration
One out of every five transactional SMS messages never reaches the client due to incorrect encoding, lack of fallback channels, or ignoring delivery statuses. Typical scenario: after registration, the user doesn't receive an OTP, loses access to their account, and switches to a competitor. We've solved these issues with SMSC integration in over 30 projects—from e-commerce stores to banking systems. Compared to standard SMS gateways, SMSC offers 99% deliverability versus typical 95%. SMSC is a Russian aggregator whose rates are 20% below market average, and support for multichannel cascades (Viber + SMS) saves up to 30% of your broadcast budget. Without proper integration, these advantages turn into headaches.
Integration Problems and Their Solutions
Incorrect Cyrillic encoding. If you don't pass charset=utf-8, SMSC defaults to CP-1251, turning text into gibberish. Solution: explicitly specify charset in every request. According to SMSC documentation, the charset parameter is mandatory for Cyrillic messages. Read more about UTF-8 encoding.
Exceeding rate limits. SMSC limits the number of messages per minute per IP. Without a queue, parts of mass broadcasts get lost. We add a message queue (Laravel Queue or Redis) and configure throttling with pauses between batches of 50 messages.
Unhandled exceptions. The API returns errors, but many developers don't verify the response. We always parse JSON, log error_code, and retry on timeout.
Why Is charset=utf-8 Important for Cyrillic?
If you forget charset=utf-8, SMSC encodes text in CP-1251 by default. Most modern sites use UTF-8, so the recipient sees unreadable characters. In every request we explicitly pass charset=utf-8 and fmt=3 for a JSON response. This guarantees correct Cyrillic display in 100% of cases.
Integration Methods
HTTP API
$response = Http::get('https://smsc.ru/sys/send.php', [
'login' => env('SMSC_LOGIN'),
'psw' => env('SMSC_PASSWORD'),
'phones' => $phone,
'mes' => $message,
'charset' => 'utf-8',
'fmt' => 3, // JSON response
'sender' => env('SMSC_SENDER_NAME')
]);
$result = $response->json();
// ['id' => 1, 'cnt' => 1] — success
// ['error' => 'Error', 'error_code' => X] — error
Official Library
SMSC provides a PHP class smsc_api.php:
require 'smsc_api.php';
$smsc = new SMSC_API();
$smsc->init(env('SMSC_LOGIN'), env('SMSC_PASSWORD'));
[$n_phones, $n_sms, $cost, $balance] = $smsc->send_sms(
$phone,
$message,
0, // translit
'', // time (delayed)
0, // id
0, // format (0=normal)
env('SMSC_SENDER_NAME')
);
Multichannel Broadcasts and Delivery Statuses
SMSC supports cascade sending: first Viber (cheaper), then SMS on failure:
Http::get('https://smsc.ru/sys/send.php', [
// ...
'viber' => 1, // try via Viber
'vk' => 1, // then VK
'phones' => $phone,
'mes' => $message
]);
If Viber fails, the system automatically retries via SMS after 5 minutes. You can configure the timeout in the API call.
How to Handle Delivery Statuses to Avoid Lost Messages?
SMS doesn't always arrive—the user is out of range, phone is off, number blocked. Without statuses, you won't know a message wasn't delivered. SMSC provides a status check API and callbacks (webhooks). We configure status retrieval and on failure use another channel (Viber, WhatsApp) or retry after 30 minutes. In 95% of cases, the message is delivered on the first attempt, but the remaining 5% require automatic handling.
| Code | Status | Description |
|---|---|---|
| -3 | In transit | Sent, awaiting delivery |
| 1 | Delivered | Successfully delivered to user (95% of cases) |
| 3 | Expired | Not delivered within 24 hours |
| 20 | Undeliverable | Number inactive or blocked |
What Does the Viber+SMS Multichannel Cascade Give You?
Viber is a cheap channel with high open rates, but not all users have it. SMSC lets you set up a cascade: send via Viber first, then SMS on failure. This reduces broadcast costs by an average of 30% and boosts deliverability to 99%. In settings, just pass the viber=1 parameter. Our integration helps clients save an average of $400 per month on SMS costs.
How to Avoid Rate Limits in Mass Broadcasts?
Mass broadcasts are the main cause of blocks. SMSC limits to 100 messages per second for the Individual plan. If exceeded, the API returns error_code=6. Solution: split sending into batches of 50 messages with pauses between them.
$batch = array_chunk($phones, 50);
foreach ($batch as $chunk) {
$response = Http::get('https://smsc.ru/sys/send.php', [...config...]);
if ($response['error'] ?? false) {
// log and wait 1 second
sleep(1);
}
}
How We Configure SMSC
Our standard stack: Laravel (PHP 8.3), Guzzle for HTTP requests, Redis for queues. Configs are stored in .env. We use the official PHP library smsc_api.php but wrap it in a service class with error handling. For multichannel cascades (first Viber, then SMS), we use the viber=1 parameter.
Process of Work
- Analysis — We study your architecture and identify SMS trigger points (registration, order confirmation, notifications).
- Design — We choose the integration method (HTTP API or library), configure the queue and throttling.
- Implementation — We write code, handle all error cases, set up callbacks for statuses.
- Testing — We send test messages, verify delivery to different numbers, simulate failures.
- Deployment — We roll out to production, set up monitoring (logs, alerts).
Timeline and Pricing
Basic integration (single channel, no queues) takes a few hours. If you need multichannel broadcasts, queues, and custom reports—up to two days. The exact cost is estimated after analyzing your project. Get a consultation to evaluate your case. Contact us to discuss details.
Basic integration starts at $300, while advanced setups with multichannel cascades and custom reporting can range up to $1,200. Over a year, typical clients save $4,800 on SMS costs through optimized routing.
Common SMSC Integration Errors
| Error Code | Description | Solution |
|---|---|---|
| 2 | Invalid login or password | Check .env |
| 4 | Insufficient funds | Top up balance |
| 6 | Rate limit exceeded | Reduce send frequency |
Other frequent mistakes:
-
charset=utf-8not set — Cyrillic turns into gibberish. - Password or login passed in plain text — use environment variables.
- API response not verified — errors missed, messages undelivered.
- No fallback channel — on SMS failure, user gets no notification.
- Queue not configured — mass broadcasts exceed SMSC limits.
What's Included
- Full SMSC integration with your Laravel or other framework site.
- Queue and throttling setup for mass broadcasts.
- Delivery status handling via callbacks or HTTP requests.
- Integration documentation and access details.
- Training your team on system usage.
- 30-day guarantee after launch — we promptly fix any issues.
Over our experience, we've completed more than 30 successful SMSC integrations for e-commerce stores, banks, and delivery services. After integration, OTP delivery rate increased from 80% to 98%, and clients report a 50% reduction in support tickets related to SMS issues. If you need reliable transactional SMS delivery, request a consultation—we'll evaluate your project and propose the optimal solution. Get a free cost estimate today.







