Skip to content

Commit

Permalink
Fix: Current AmfUe is deleted when AMF receives UEContextRelease of p…
Browse files Browse the repository at this point in the history
…revious session (#60)
  • Loading branch information
RyuichiNamba-fj authored Feb 6, 2022
1 parent ef88963 commit b6f0ccd
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions ngap/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -1904,6 +1904,14 @@ func HandleUEContextReleaseRequest(ran *context.AmfRan, message *ngapType.NGAPPD

amfUe := ranUe.AmfUe
if amfUe != nil {
if !isLatestAmfUe(amfUe) {
amfUe.DetachRanUe(ran.AnType)
ranUe.DetachAmfUe()
gmm_common.StopAll5GSMMTimers(amfUe)
causeValue = ngapType.CauseRadioNetworkPresentReleaseDueToNgranGeneratedReason
ngap_message.SendUEContextReleaseCommand(ranUe, context.UeContextReleaseUeContext, causeGroup, causeValue)
return
}
gmm_common.StopAll5GSMMTimers(amfUe)
causeAll := context.CauseAll{
NgapCause: &models.NgApCause{
Expand Down Expand Up @@ -4082,3 +4090,12 @@ func buildCriticalityDiagnosticsIEItem(ieCriticality aper.Enumerated, ieID int64

return item
}

func isLatestAmfUe(amfUe *context.AmfUe) bool {
if latestAmfUe, ok := context.AMF_Self().AmfUeFindByUeContextID(amfUe.Supi); ok {
if amfUe == latestAmfUe {
return true
}
}
return false
}

0 comments on commit b6f0ccd

Please sign in to comment.