Skip to content

Commit

Permalink
Addressed the suggested comments to change the state in UeCmDeregistr…
Browse files Browse the repository at this point in the history
…ation()
  • Loading branch information
saileshvvr committed Jan 6, 2024
1 parent c038147 commit 5fd45fb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
12 changes: 8 additions & 4 deletions internal/sbi/consumer/ue_context_management.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import (
func UeCmRegistration(smCtx *smf_context.SMContext) (
*models.ProblemDetails, error,
) {
uecmUri := util.SearchNFServiceUri(smf_context.GetSelf().UDMProfile, models.ServiceName_NUDM_UECM, models.NfServiceStatus_REGISTERED)
uecmUri := util.SearchNFServiceUri(smf_context.GetSelf().UDMProfile, models.ServiceName_NUDM_UECM,
models.NfServiceStatus_REGISTERED)
if uecmUri == "" {
return nil, errors.Errorf("SMF can not select an UDM by NRF: SearchNFServiceUri failed")
}
Expand All @@ -36,8 +37,9 @@ func UeCmRegistration(smCtx *smf_context.SMContext) (
PgwFqdn: "",
}

logger.PduSessLog.Infoln("UECM Registration SmfInstanceId:", registrationData.SmfInstanceId, " PduSessionId:", registrationData.PduSessionId,
" SNssai:", registrationData.SingleNssai, " Dnn:", registrationData.Dnn, " PlmnId:", registrationData.PlmnId)
logger.PduSessLog.Infoln("UECM Registration SmfInstanceId:", registrationData.SmfInstanceId,
" PduSessionId:", registrationData.PduSessionId, " SNssai:", registrationData.SingleNssai,
" Dnn:", registrationData.Dnn, " PlmnId:", registrationData.PlmnId)

_, httpResp, localErr := client.SMFRegistrationApi.SmfRegistrationsPduSessionId(context.Background(),
smCtx.Supi, smCtx.PduSessionId, registrationData)
Expand Down Expand Up @@ -65,7 +67,8 @@ func UeCmRegistration(smCtx *smf_context.SMContext) (
}

func UeCmDeregistration(smCtx *smf_context.SMContext) (*models.ProblemDetails, error) {
uecmUri := util.SearchNFServiceUri(smf_context.GetSelf().UDMProfile, models.ServiceName_NUDM_UECM, models.NfServiceStatus_REGISTERED)
uecmUri := util.SearchNFServiceUri(smf_context.GetSelf().UDMProfile, models.ServiceName_NUDM_UECM,
models.NfServiceStatus_REGISTERED)
if uecmUri == "" {
return nil, errors.Errorf("SMF can not select an UDM by NRF: SearchNFServiceUri failed")
}
Expand All @@ -85,6 +88,7 @@ func UeCmDeregistration(smCtx *smf_context.SMContext) (*models.ProblemDetails, e
}
}()
if localErr == nil {
smCtx.UeCmRegistered = false
return nil, nil
} else if httpResp != nil {
if httpResp.Status != localErr.Error() {
Expand Down
3 changes: 0 additions & 3 deletions internal/sbi/producer/pdu_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,6 @@ func HandlePDUSessionSMContextUpdate(smContextRef string, body models.UpdateSmCo
} else {
logger.PduSessLog.Traceln("UECM_DeRegistration successful")
}
smContext.UeCmRegistered = false
}

cause := nasMessage.Cause5GSMRegularDeactivation
Expand Down Expand Up @@ -893,7 +892,6 @@ func HandlePDUSessionSMContextRelease(smContextRef string, body models.ReleaseSm
} else {
logger.PduSessLog.Traceln("UECM_DeRegistration successful")
}
smContext.UeCmRegistered = false
}

if !smContext.CheckState(smf_context.InActive) {
Expand Down Expand Up @@ -993,7 +991,6 @@ func HandlePDUSessionSMContextLocalRelease(smContext *smf_context.SMContext, cre
} else {
logger.PduSessLog.Traceln("UECM_DeRegistration successful")
}
smContext.UeCmRegistered = false
}

smContext.SetState(smf_context.PFCPModification)
Expand Down

0 comments on commit 5fd45fb

Please sign in to comment.