You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用Jasmin SMS Gateway连接SMSC失败求助

Jasmin SMS Gateway连接SMSC超时故障排查与解决

从你提供的日志来看,核心问题是TCP连接超时错误(twisted.internet.error.TimeoutError),Jasmin网关无法在规定时间内与目标SMSC的172.xx.xx.xx:2775端口建立连接。以下是具体故障原因分析和解决步骤:

故障原因

  • SMSC服务未正常对外提供服务:对方的SMSC服务可能未启动、端口2775未开放,或者你的网关IP不在对方的访问白名单内。
  • 网络链路异常:网关服务器到SMSC服务器之间存在路由丢包、延迟过高,导致连接请求超时;或者双方的防火墙/安全组限制了2775端口的通信。
  • Jasmin配置细节错误:虽然你检查了网络,但可能存在SMSC连接参数(IP、端口、协议类型)配置错误,或者连接超时时间设置过短。

解决步骤

  1. 验证基础网络连通性

    • 在Jasmin服务器上执行端口连通性测试:
      # 使用telnet测试
      telnet 172.xx.xx.xx 2775
      # 或使用nc工具(更直观)
      nc -zv 172.xx.xx.xx 2775
      
      如果测试失败,直接说明网络或对方服务存在问题。
    • 用路由追踪工具排查链路问题:
      # Linux系统
      traceroute 172.xx.xx.xx
      # Windows系统(如果是Windows部署)
      tracert 172.xx.xx.xx
      
      查看输出中的延迟和丢包节点,定位网络瓶颈。
  2. 确认SMSC服务状态

    • 联系SMSC服务商或管理员,确认:
      • 对方SMSC服务是否正常运行
      • 端口2775是否对外开放
      • 你的Jasmin服务器IP是否在对方的访问白名单中
  3. 检查Jasmin的SMSC配置

    • 打开Jasmin的SMSC配置文件(默认路径:/etc/jasmin/smscs.yml),核对以下参数:
      • host和port是否与服务商提供的完全一致
      • protocol是否匹配(例如对方使用SMPP over TCP,配置中需对应smpp协议)
      • 尝试调大connect_timeout参数(默认可能为4秒,可改为10秒),避免因短暂网络波动导致超时
  4. 排查本地防火墙与安全组

    • 检查Jasmin服务器上的防火墙规则,确保允许出站访问2775端口:
      # UFW防火墙示例
      sudo ufw allow out 2775/tcp
      # Firewalld防火墙示例
      sudo firewall-cmd --add-port=2775/tcp --permanent
      sudo firewall-cmd --reload
      
    • 如果是云服务器,检查云平台的安全组规则,确认放行TCP 2775的出站请求。
  5. 重启服务并验证

    • 修改配置或调整防火墙后,重启Jasmin服务:
      sudo systemctl restart jasmin
      
    • 查看日志(/var/log/jasmin/jasmin.log),观察是否仍出现超时错误。

报错日志参考

2023-04-14 10:57:26 INFO     1 Reconnecting after 10 seconds ...
2023-04-14 10:57:36 INFO     1 Connecting to IPv4Address(type='TCP', host='172.xx.xx.xx', port=2775) ...
2023-04-14 10:57:40 ERROR    1 Connection failed. Reason: [Failure instance: Traceback (failure with no frames): <class 'twisted.internet.error.TimeoutError'>: User timeout caused connection failure.
]
2023-04-14 10:57:40 INFO     1 Reconnecting after 10 seconds ...
2023-04-14 10:57:43 ERROR    1 Connection failed. Reason: [Failure instance: Traceback (failure with no frames): <class 'twisted.internet.error.TimeoutError'>: User timeout caused connection failure.
]

内容的提问来源于stack exchange,提问作者Ange Guillaume Koffi

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.24 18:47:02