Skip to content

Commit

Permalink
Modify RegistrationStatusUpdateProcedure:
Browse files Browse the repository at this point in the history
* currently only consider the 3GPP access type
  • Loading branch information
iamelisahi committed Aug 17, 2023
1 parent 01a4c45 commit 56aae04
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 30 deletions.
33 changes: 3 additions & 30 deletions internal/sbi/httpcallback/api_handle_dereg_notification.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"github.com/free5gc/amf/internal/logger"
"github.com/free5gc/amf/internal/sbi/consumer"
"github.com/free5gc/openapi"
"github.com/free5gc/openapi/Nudm_SubscriberDataManagement"
"github.com/free5gc/openapi/Nudm_UEContextManagement"
"github.com/free5gc/openapi/models"
)
Expand Down Expand Up @@ -135,41 +134,15 @@ func HTTPAmfHandleDeregistrationNotification(c *gin.Context) {

// TS 23.502 - 4.2.2.3.3 Network-initiated Deregistration
// The AMF also unsubscribes with the UDM using Nudm_SDM_Unsubscribe service operation.
configuration := Nudm_SubscriberDataManagement.NewConfiguration()
configuration.SetBasePath(ue.NudmSDMUri)
client := Nudm_SubscriberDataManagement.NewAPIClient(configuration)
var httpResp *http.Response
httpResp, err = client.SubscriptionDeletionApi.Unsubscribe(context.Background(), ue.Supi, ue.SdmSubscriptionId)
if err != nil {
logger.CallbackLog.Errorf("AMF unsubscribes the UE[%s] with the UDM: %v", ue.Supi, err)
problemDetails, err := consumer.SDMUnsubscribe(ue)
if problemDetails != nil {
logger.CallbackLog.Errorf("AMF SDM Unsubscribe: %+v", problemDetails)
}
defer func() {
err = httpResp.Body.Close()
if err != nil {
logger.CallbackLog.Errorf("Body close error %v", err)
}
}()

switch httpResp.StatusCode {
case 204:
// Successful response
case 404:
problemDetails := &models.ProblemDetails{
Status: http.StatusNotFound,
Cause: "CONTEXT_NOT_FOUND",
}
c.JSON(http.StatusNotFound, problemDetails)
return
default:
logger.CallbackLog.Warningf("No handler for status during unsubscribe procedure: %v", httpResp.Status)
}

// TS 23.502 - 4.2.2.2.2 General Registration
// The old AMF should clean the UE context
ue.Remove()

// TS 23.503 - 5.3.2.3.2 UDM initiated NF Deregistration
// The AMF acknowledges the Nudm_UECM_DeRegistrationNotification to the UDM.
c.JSON(http.StatusNoContent, nil)
// return
}
1 change: 1 addition & 0 deletions internal/sbi/producer/ue_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,7 @@ func RegistrationStatusUpdateProcedure(ueContextID string, ueRegStatusUpdateReqD
logger.GmmLog.Errorf("AM Policy Control Delete Error[%v]", err.Error())
}
}
// TODO: Currently only consider the 3GPP access type
if !ue.UeCmRegistered[models.AccessType__3_GPP_ACCESS] {
gmm_common.RemoveAmfUe(ue, false)
}
Expand Down

0 comments on commit 56aae04

Please sign in to comment.