# smpp-gateway **Repository Path**: qiusu/smpp-gateway ## Basic Information - **Project Name**: smpp-gateway - **Description**: smpp-gateway是一个基于springboot+jsmpp的网关,专注于实现SMPP协议的网关服务,可以用来模拟短信平台用于接收smpp协议客服端的消息,并实现阿里云等主流短信平台的转发或其它业务功能,适用于短信收发、消息中继等场景,支持高并发与多协议转换。 - **Primary Language**: Java - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2025-08-28 - **Last Updated**: 2025-09-05 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # smpp-gateway #### 介绍 smpp-gateway是一个基于springboot+jsmpp的网关,专注于实现SMPP协议的网关服务,可以用来模拟短信平台用于接收smpp协议客服端的消息,并实现阿里云等主流短信平台的转发或其它业务功能,适用于短信收发、消息中继等场景,支持高并发与多协议转换。 #### 用途 针对那些不支持阿里云、腾讯云、华为等主流短信平台,但支持SMPP协议的系统(如ThingsBoard物联网平台),在不修改其源代码的前提下,可以通过部署本服务实现短信功能的无缝对接。 #### 软件架构 springboot3+jdk17+jsmpp+sms4j #### 使用说明 本系统使用开源项目[sms4j(点击跳转官方文档)](https://sms4j.com/)进行短信发送,也可以根据自己需求自行集成其它业务功能, 1. 业务集成net.boot.smpp.service.impl.MessageGatewayServiceImpl.business ![img.png](images/business_img.png) 2. 短信平台设置配置文件 本系统使用开源项目[sms4j(点击跳转官方文档)](https://sms4j.com/)进行短信发送,配置文件如下 ```yaml sms: config-type: yaml blends: 自定义标识1: #阿里云的accessKey accessKeyId: 您的accessKey #阿里云的accessKeySecret accessKeySecret: 您的accessKeySecret #短信签名 signature: 测试签名 #模板ID 用于发送固定模板短信使用 templateId: SMS_215125134 #模板变量 上述模板的变量 templateName: code #请求地址 默认为dysmsapi.aliyuncs.com 如无特殊改变可以不用设置 requestUrl: dysmsapi.aliyuncs.com 自定义标识2: #华为短信appKey appKey: 5N6fvXXXX920HaWhVXXXXXX7fYa #华为短信appSecret app-secret: Wujt7EYzZTBXXXXXXEhSP6XXXX #短信签名 signature: 华为短信测试 #通道号 sender: 8823040504797 #模板ID 如果使用自定义模板发送方法可不设定 template-id: acXXXXXXXXc274b2a8263479b954c1ab5 #华为回调地址,如不需要可不设置或为空 statusCallBack: #华为分配的app请求地址 url: https://XXXXX.cn-north-4.XXXXXXXX.com:443 自定义标识3: #助通短信 #助通终端用户管理的用户名 username 必填;非登录账号密码,请登录后台管理地址进行查看:https://mix2.zthysms.com/login accessKeyId: tusxxxxxxXXX #助通终端用户管理的用户名 passwrod 必填; accessKeySecret: UbXXXxxx #短信签名,可选;可选的时候,只能使用自定义短信不能使用模板短信; 具体在这里查看审核过的短信签名:https://mix2.zthysms.com/index.html#/SignatureManagement signature: 上海千XXXX ``` #### 安装教程 1. jar部署 java -jar smpp-gateway-1.0.jar 2. docker容器部署 #### 构建镜像 docker build -t smpp-gateway:1.0 . #### 创建并启动容器 docker run --name smpp_gateway -d -p 8055:8055 -p 8056:8056 smpp-gateway:1.0 #### 启动成功示例:访问 http://ip:8055/smpp/health ![img.png](images/img.png)