fix: UDM签约cag参数允许为空

This commit is contained in:
TsMask
2024-12-11 15:41:05 +08:00
parent 87a2b299c7
commit f5ebd1c581
2 changed files with 4 additions and 7 deletions

View File

@@ -188,10 +188,7 @@ func (s *UDMSubController) Adds(c *gin.Context) {
// 发送MML
cmd := fmt.Sprintf("baa udmuser:start_imsi=%s,start_msisdn=%s,sub_num=%s,", body.IMSI, body.MSISDN, num)
cmd += s.udmSubService.ParseCommandParams(body)
// static_ip指给4G UE分配的静态IP没有可不带此字段名批量添加IP会自动递增
if body.StaticIp != "" {
cmd += fmt.Sprintf(",static_ip=%s", body.StaticIp)
}
// 去除msisdn参数避免重复
omemsisdn := fmt.Sprintf(",msisdn=%s,", body.MSISDN)
cmd = strings.Replace(cmd, omemsisdn, ",", 1)
data, err := telnet.ConvertToStr(telnetClient, cmd)