Module 7 · Webhook & carrier error lab
交互式 DLR Webhook 标准化器、运营商错误分类器与 HMAC-SHA256 验证器
故障转移重试
- SMPP_0x00000014 · SMPP_GSM
- failover_immediately
- 150ms
- carrier congestion
- ClickSend → Textmagic
实时签名与幂等性检查器
- evt_uk_ie_otp_smpp0x00000014
- idem_uk_ie_otp_99481a
- 1794240000
X-IOSOR-Signature-256: t=1794240000,v1=77e70bf44d0162ce77e70bf44d0162ce77e70bf44d0162ce77e70bf44d0162ce
标准化 DLR Webhook 载荷
{
"schema": "https://iosor.com/schemas/normalized-dlr-webhook-v1.json",
"eventId": "evt_uk_ie_otp_smpp0x00000014",
"idempotencyKey": "idem_uk_ie_otp_99481a",
"timestampUnix": 1794240000,
"corridor": "UK_IE",
"workload": "otp",
"originRail": {
"role": "primary",
"partnerId": "clicksend",
"partnerName": "ClickSend"
},
"telemetry": {
"protocol": "SMPP_GSM",
"errorCode": "SMPP_0x00000014",
"errorTitle": "Message Queue Full / MSC Congestion (0x14)",
"category": "carrier_congestion"
},
"routerDecision": {
"retryableOnFailover": true,
"action": "failover_immediately",
"targetFailoverPartnerId": "textmagic",
"targetFailoverPartnerName": "Textmagic",
"failoverDelayMs": 150,
"idempotencyTtlSec": 86400
}
}HMAC-SHA256 验证中间件
// IOSOR 2027 Webhook HMAC-SHA256 + Replay & Idempotency Guard (Node / Edge)
import crypto from 'node:crypto';
export function verifyAndClassifyWebhook(
rawBody: string,
signatureHeader: string,
secret: string,
seenIdempotencyKeys: Set<string>,
toleranceSec = 300
) {
const parts = Object.fromEntries(signatureHeader.split(',').map((p) => p.split('=')));
const ts = Number(parts.t || 0);
if (Math.abs(Math.floor(Date.now() / 1000) - ts) > toleranceSec) {
throw new Error('WEBHOOK_REPLAY_WINDOW_EXPIRED');
}
const expected = crypto
.createHmac('sha256', secret)
.update(`${ts}.${rawBody}`)
.digest('hex');
if (!crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(parts.v1 || ''))) {
throw new Error('WEBHOOK_SIGNATURE_MISMATCH');
}
const event = JSON.parse(rawBody);
if (seenIdempotencyKeys.has(event.idempotencyKey)) {
return { status: 'duplicate_ignored', action: 'noop' };
}
seenIdempotencyKeys.add(event.idempotencyKey);
return {
status: 'verified',
action: event.routerDecision.action,
failoverPartnerId: event.routerDecision.targetFailoverPartnerId,
};
}IOSOR 专家权威认证 · B2B 路由、合规与服务商问答
IOSOR 通信专家 — 权威问答 (Q&A) 与已验证服务商对比
以下每条问答均由 IOSOR 电信架构专家根据 90 天 SLA 可用率遥测、各国运营商合规要求(10DLC、DLT、GDPR)及真实 TCO 成本核验。
#01 · 合规📖 知识中心 · US A2P / 10DLC
US A2P / 10DLC
“US A2P / 10DLC: 美国 · 合规?”
✓ IOSOR 专家已核验
面向美国 A2P 的 10DLC 品牌与活动计划——不是一般隐私合规。
#02 · 验证 / OTP📖 知识中心 · India DLT
India DLT
“India DLT: 模板目录、评论和单元类别 - 与频道实时徽章分开。?”
✓ IOSOR 专家已核验
印度 A2P 的 DLT 与 PE-TM 登记——不是印度走廊覆盖指南。
#03 · 验证 / OTP📖 知识中心 · 验证 / OTP
验证 / OTP
“验证 / OTP: 稳定的登录验证码:防滥用、延迟与成本控制。?”
✓ IOSOR 专家已核验
稳定的登录验证码:防滥用、延迟与成本控制。
#06 · WhatsApp Business · RCS📖 知识中心 · WhatsApp 与 RCS
WhatsApp 与 RCS
“WhatsApp 与 RCS: 生产流量前完成 10DLC、免费号码验证与隐私准备。?”
✓ IOSOR 专家已核验
配置与模板就绪后使用富媒体渠道:如实说明开通条件。
#08 · 故障切换与通道📖 知识中心 · 故障切换与通道
故障切换与通道
“故障切换与通道: PAYG Failover · 月度预算范围?”
✓ IOSOR 专家已核验
主通道故障时按顺序启用备用路径,与 DLR 状态判断相互独立。












