Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

send reroute nas msg if SendN1MessageNotifyAtAMFReAllocation failed #117

Merged
merged 1 commit into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions internal/gmm/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -1096,6 +1096,7 @@ func handleRequestedNssai(ue *context.AmfUe, anType models.AccessType) error {
amfSelf := context.GetSelf()

if ue.RegistrationRequest.RequestedNSSAI != nil {
logger.GmmLog.Infof("RequestedNssai: %+v", ue.RegistrationRequest.RequestedNSSAI)
requestedNssai, err := nasConvert.RequestedNssaiToModels(ue.RegistrationRequest.RequestedNSSAI)
if err != nil {
return fmt.Errorf("Decode failed at RequestedNSSAI[%s]", err)
Expand Down Expand Up @@ -1128,6 +1129,7 @@ func handleRequestedNssai(ue *context.AmfUe, anType models.AccessType) error {

if !amfSelf.InPlmnSupportList(reqSnssai) {
needSliceSelection = true
logger.GmmLog.Warnf("RequestedNssai[%+v] is not supported by AMF", reqSnssai)
break
}
}
Expand Down Expand Up @@ -1198,6 +1200,7 @@ func handleRequestedNssai(ue *context.AmfUe, anType models.AccessType) error {
}
}

sendReroute := true
err = consumer.SearchAmfCommunicationInstance(ue, amfSelf.NrfUri,
models.NfType_AMF, models.NfType_AMF, &searchTargetAmfQueryParam)
if err == nil {
Expand Down Expand Up @@ -1229,10 +1232,17 @@ func handleRequestedNssai(ue *context.AmfUe, anType models.AccessType) error {
var n1Message bytes.Buffer
err = ue.RegistrationRequest.EncodeRegistrationRequest(&n1Message)
if err != nil {
return fmt.Errorf("re-encoding registration request message is failed: %w", err)
logger.GmmLog.Errorf("re-encoding registration request message is failed: %+v", err)
} else {
err = callback.SendN1MessageNotifyAtAMFReAllocation(ue, n1Message.Bytes(), &registerContext)
if err != nil {
logger.GmmLog.Errorf("send N1MessageNotify failed: %+v", err)
} else {
sendReroute = false
}
}
callback.SendN1MessageNotifyAtAMFReAllocation(ue, n1Message.Bytes(), &registerContext)
} else {
}
if sendReroute {
// Condition (B) Step 7: initial AMF can not find Target AMF via NRF -> Send Reroute NAS Request to RAN
allowedNssaiNgap := ngapConvert.AllowedNssaiToNgap(ue.AllowedNssai[anType])
ngap_message.SendRerouteNasRequest(ue, anType, nil, ue.RanUe[anType].InitialUEMessage, &allowedNssaiNgap)
Expand Down
5 changes: 4 additions & 1 deletion internal/sbi/producer/callback/n1n2message.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ func SendN1MessageNotify(ue *amf_context.AmfUe, n1class models.N1MessageClass, n
// TS 29.518 5.2.2.3.5.2
func SendN1MessageNotifyAtAMFReAllocation(
ue *amf_context.AmfUe, n1Msg []byte, registerContext *models.RegistrationContextContainer,
) {
) error {
logger.CommLog.Infoln("Send N1 Message Notify at AMF Re-allocation")
configuration := Namf_Communication.NewConfiguration()
client := Namf_Communication.NewAPIClient(configuration)

Expand Down Expand Up @@ -122,7 +123,9 @@ func SendN1MessageNotifyAtAMFReAllocation(
} else if err.Error() != httpResp.Status {
HttpLog.Errorln(err.Error())
}
return err
}
return nil
}

func SendN2InfoNotify(ue *amf_context.AmfUe, n2class models.N2InformationClass, n1Msg, n2Msg []byte) {
Expand Down