Skip to content

Commit

Permalink
Modify SendConfigurationUpdateCommand
Browse files Browse the repository at this point in the history
* Add ConfigurationUpdateCommandFlags parameter to control how to build the Configuration Update Command message.
* Determine whether to start the T3555 timer or not in the SendConfigurationUpdateCommand.
  • Loading branch information
YouShengLiu committed Aug 17, 2023
1 parent 08ed8d8 commit 86e3990
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 47 deletions.
24 changes: 1 addition & 23 deletions internal/gmm/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -2164,29 +2164,7 @@ func HandleRegistrationComplete(ue *context.AmfUe, accessType models.AccessType,
configurationUpdateCommandFlags := &gmm_message.ConfigurationUpdateCommandFlags{
NeedNITZ: true,
}

nasMsg, err, startT3555 := gmm_message.BuildConfigurationUpdateCommand(ue, accessType, nil,
configurationUpdateCommandFlags,
)
if err != nil {
ue.GmmLog.Errorf("HandleRegistrationComplete: %+v", err)
}
if startT3555 && context.GetSelf().T3555Cfg.Enable {
cfg := context.GetSelf().T3555Cfg
ue.T3555 = context.NewTimer(context.GetSelf().T3555Cfg.ExpireTime,
context.GetSelf().T3555Cfg.MaxRetryTimes,
func(expireTimes int32) {
ue.GmmLog.Warnf("T3555 expires, retransmit Configuration Update Command (retry: %d)",
expireTimes)
gmm_message.SendConfigurationUpdateCommand(ue, models.AccessType__3_GPP_ACCESS, nasMsg)
},
func() {
ue.GmmLog.Warnf("T3555 Expires %d times, abort configuration update procedure",
cfg.MaxRetryTimes)
},
)
}
gmm_message.SendConfigurationUpdateCommand(ue, models.AccessType__3_GPP_ACCESS, nasMsg)
gmm_message.SendConfigurationUpdateCommand(ue, accessType, configurationUpdateCommandFlags)

// if registrationComplete.SORTransparentContainer != nil {
// TODO: if at regsitration procedure 14b, udm provide amf Steering of Roaming info & request an ack,
Expand Down
1 change: 0 additions & 1 deletion internal/gmm/message/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,6 @@ func BuildConfigurationUpdateCommand(ue *context.AmfUe, anType models.AccessType
configurationUpdateCommand.UniversalTimeAndLocalTimeZone == nil &&
configurationUpdateCommand.LocalTimeZone == nil &&
configurationUpdateCommand.NetworkDaylightSavingTime == nil) {

needTimer = false
return nil, fmt.Errorf("Configuration Update Command is invaild"), needTimer
}
Expand Down
27 changes: 26 additions & 1 deletion internal/gmm/message/send.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,10 @@ func SendServiceAccept(amfUe *context.AmfUe, anType models.AccessType,
return nil
}

func SendConfigurationUpdateCommand(amfUe *context.AmfUe, accessType models.AccessType, nasMsg []byte) {
func SendConfigurationUpdateCommand(amfUe *context.AmfUe,
accessType models.AccessType,
flags *ConfigurationUpdateCommandFlags,
) {
if amfUe == nil {
logger.GmmLog.Error("SendConfigurationUpdateCommand: AmfUe is nil")
return
Expand All @@ -189,8 +192,30 @@ func SendConfigurationUpdateCommand(amfUe *context.AmfUe, accessType models.Acce
}
amfUe.GmmLog.Info("Send Configuration Update Command")

nasMsg, err, startT3555 := BuildConfigurationUpdateCommand(amfUe, accessType, nil, flags)
if err != nil {
amfUe.GmmLog.Errorf("BuildConfigurationUpdateCommand Error: %+v", err)
}

mobilityRestrictionList := ngap_message.BuildIEMobilityRestrictionList(amfUe)
ngap_message.SendDownlinkNasTransport(amfUe.RanUe[accessType], nasMsg, &mobilityRestrictionList)

if startT3555 && context.GetSelf().T3555Cfg.Enable {
cfg := context.GetSelf().T3555Cfg
amfUe.GmmLog.Infof("Start T3555 timer")
amfUe.T3555 = context.NewTimer(context.GetSelf().T3555Cfg.ExpireTime,
context.GetSelf().T3555Cfg.MaxRetryTimes,
func(expireTimes int32) {
amfUe.GmmLog.Warnf("T3555 expires, retransmit Configuration Update Command (retry: %d)",
expireTimes)
ngap_message.SendDownlinkNasTransport(amfUe.RanUe[accessType], nasMsg, &mobilityRestrictionList)
},
func() {
amfUe.GmmLog.Warnf("T3555 Expires %d times, abort configuration update procedure",
cfg.MaxRetryTimes)
},
)
}
}

func SendAuthenticationReject(ue *context.RanUe, eapMsg string) {
Expand Down
23 changes: 1 addition & 22 deletions internal/sbi/producer/callback.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,31 +165,10 @@ func AmPolicyControlUpdateNotifyUpdateProcedure(polAssoID string,

// UE is CM-Connected State
if ue.CmConnect(models.AccessType__3_GPP_ACCESS) {
nasMsg, err, startT3555 := gmm_message.BuildConfigurationUpdateCommand(ue,
gmm_message.SendConfigurationUpdateCommand(ue,
models.AccessType__3_GPP_ACCESS,
nil,
configurationUpdateCommandFlags,
)
if err != nil {
ue.GmmLog.Error(err.Error())
return
}
if startT3555 && context.GetSelf().T3555Cfg.Enable {
cfg := context.GetSelf().T3555Cfg
ue.T3555 = context.NewTimer(context.GetSelf().T3555Cfg.ExpireTime,
context.GetSelf().T3555Cfg.MaxRetryTimes,
func(expireTimes int32) {
ue.GmmLog.Warnf("T3555 expires, retransmit Configuration Update Command (retry: %d)",
expireTimes)
gmm_message.SendConfigurationUpdateCommand(ue, models.AccessType__3_GPP_ACCESS, nasMsg)
},
func() {
ue.GmmLog.Warnf("T3555 Expires %d times, abort configuration update procedure",
cfg.MaxRetryTimes)
},
)
}
gmm_message.SendConfigurationUpdateCommand(ue, models.AccessType__3_GPP_ACCESS, nasMsg)

// UE is CM-IDLE => paging
} else {
Expand Down

0 comments on commit 86e3990

Please sign in to comment.