Dispatcher 灰度流量路由异常

问题现象

非灰度租户(test.example.internal)的呼叫被路由到灰度机器 192.168.15.52:18627。


根因

Edge 节点 OpenSIPS 内存缓存中 dispatcher destination attributes 未及时更新:

  • DB 中 attr 已更新为 Core-Gray
  • Edge 节点内存仍使用旧值 Core
  • 灰度判断逻辑依赖 attr 字段,导致路由错误

排查过程

1. 查看 ds_list 发现异常

1
docker exec -it 9e7f274e8f64 opensipsctl fifo ds_list

SET:: 1 中 192.168.15.52 的 attr 显示为 Core,应为 Core-Gray。

2. 执行 ds_reload

1
opensipsctl fifo ds_reload

3. 验证修复

192.168.15.52 移至 SET:: 10,attr 正确显示为 Core-Gray。


关键日志

修复前 - 192.168.15.52 的 attr 错误显示为 Core:

1
2
3
SET:: 1
URI:: sip:192.168.15.52:18627 state=Active first_hit_counter=156
attr:: Core ← ❌ 错误

修复后 - 正确显示为 Core-Gray:

1
2
3
SET:: 10
URI:: sip:192.168.15.52:18627 state=Active first_hit_counter=0
attr:: Core-Gray ← ✅ 正确

解决方案

1
2
opensipsctl fifo ds_reload
opensipsctl fifo ds_list # 验证

预防措施

修改 dispatcher 配置后必须执行 ds_reload 或重启服务。


关键命令

命令 用途
opensipsctl fifo ds_list 查看所有 dispatcher destinations
opensipsctl fifo ds_reload 从数据库重新加载 dispatcher 配置
opensipsctl fifo ds_set_state 动态修改 destination 状态


© 2018–2026 小周周 · 使用 Stellar 构建

站内搜索

没有找到内容!