diff --git a/src/amf/nudm-build.c b/src/amf/nudm-build.c index 8b1f62b7a..89a16b7a2 100644 --- a/src/amf/nudm-build.c +++ b/src/amf/nudm-build.c @@ -75,6 +75,7 @@ ogs_sbi_request_t *amf_nudm_uecm_build_registration( ogs_error("No rat_type"); goto end; } + Amf3GppAccessRegistration.pei = amf_ue->pei; message.Amf3GppAccessRegistration = &Amf3GppAccessRegistration; diff --git a/src/pcf/npcf-handler.c b/src/pcf/npcf-handler.c index 4941ef8bb..c7e518d68 100644 --- a/src/pcf/npcf-handler.c +++ b/src/pcf/npcf-handler.c @@ -112,26 +112,9 @@ bool pcf_npcf_am_policy_contrtol_handle_create(pcf_ue_t *pcf_ue, pcf_ue->access_type = PolicyAssociationRequest->access_type; if (PolicyAssociationRequest->pei) { - char *type = NULL, *value = NULL; if (pcf_ue->pei) ogs_free(pcf_ue->pei); pcf_ue->pei = ogs_strdup(PolicyAssociationRequest->pei); - - type = ogs_id_get_type(pcf_ue->pei); - ogs_assert(type); - value = ogs_id_get_value(pcf_ue->pei); - ogs_assert(value); - - if (strcmp(type, "imeisv") == 0) { - ogs_assert(OGS_OK == ogs_dbi_update_imeisv(pcf_ue->supi, value)); - } else { - ogs_fatal("Unknown Type = %s", type); - ogs_assert_if_reached(); - } - - - ogs_free(type); - ogs_free(value); } Guami = PolicyAssociationRequest->guami; diff --git a/src/udr/nudr-handler.c b/src/udr/nudr-handler.c index 3927fee2f..653f27543 100644 --- a/src/udr/nudr-handler.c +++ b/src/udr/nudr-handler.c @@ -294,6 +294,30 @@ bool udr_nudr_dr_handle_subscription_context( return false; } + if (Amf3GppAccessRegistration->pei) { + char *type = NULL, *value = NULL; + char *pei = NULL; + + pei = ogs_strdup(Amf3GppAccessRegistration->pei); + ogs_assert(pei); + + type = ogs_id_get_type(pei); + ogs_assert(type); + value = ogs_id_get_value(pei); + ogs_assert(value); + + if (strcmp(type, "imeisv") == 0) { + ogs_assert(OGS_OK == ogs_dbi_update_imeisv(supi, value)); + } else { + ogs_fatal("Unknown Type = %s", type); + ogs_assert_if_reached(); + } + + ogs_free(pei); + ogs_free(type); + ogs_free(value); + } + memset(&sendmsg, 0, sizeof(sendmsg)); response = ogs_sbi_build_response( diff --git a/tests/unit/nas-message-test.c b/tests/unit/nas-message-test.c index dd8ccdd0c..5ec4d0dc3 100644 --- a/tests/unit/nas-message-test.c +++ b/tests/unit/nas-message-test.c @@ -373,19 +373,19 @@ static void ogs_nas_eps_message_test9(abts_case *tc, void *data) ABTS_INT_EQUAL(tc, 31, gprs_timer.value); rv = ogs_nas_gprs_timer_from_sec(&gprs_timer, 60*32); ABTS_INT_EQUAL(tc, OGS_ERROR, rv); - rv = ogs_nas_gprs_timer_from_sec(&gprs_timer, 60*10*4); + rv = ogs_nas_gprs_timer_from_sec(&gprs_timer, 60*6*8); ABTS_INT_EQUAL(tc, OGS_OK, rv); ABTS_INT_EQUAL(tc, OGS_NAS_GPRS_TIMER_UNIT_MULTIPLES_OF_DECI_HH, gprs_timer.unit); - ABTS_INT_EQUAL(tc, 4, gprs_timer.value); - rv = ogs_nas_gprs_timer_from_sec(&gprs_timer, 60*10*4+1); + ABTS_INT_EQUAL(tc, 8, gprs_timer.value); + rv = ogs_nas_gprs_timer_from_sec(&gprs_timer, 60*6*8+1); ABTS_INT_EQUAL(tc, OGS_ERROR, rv); - rv = ogs_nas_gprs_timer_from_sec(&gprs_timer, 60*10*31); + rv = ogs_nas_gprs_timer_from_sec(&gprs_timer, 60*6*31); ABTS_INT_EQUAL(tc, OGS_OK, rv); ABTS_INT_EQUAL(tc, OGS_NAS_GPRS_TIMER_UNIT_MULTIPLES_OF_DECI_HH, gprs_timer.unit); ABTS_INT_EQUAL(tc, 31, gprs_timer.value); - rv = ogs_nas_gprs_timer_from_sec(&gprs_timer, 60*10*32); + rv = ogs_nas_gprs_timer_from_sec(&gprs_timer, 60*6*32); ABTS_INT_EQUAL(tc, OGS_ERROR, rv); rv = ogs_nas_gprs_timer_3_from_sec(&gprs_timer, 1);