[SMF] Gy: Tear down session when CCR-Update is rejected by OCS

This commit is contained in:
Pau Espin 2024-03-19 16:00:47 +01:00 committed by Sukchan Lee
parent f66c65b9cf
commit 10a0647f09
4 changed files with 27 additions and 23 deletions

View File

@ -716,6 +716,9 @@ void smf_gsm_state_operational(ogs_fsm_t *s, smf_event_t *e)
ogs_pfcp_xact_t *pfcp_xact = NULL;
ogs_pfcp_message_t *pfcp_message = NULL;
ogs_diam_gy_message_t *gy_message = NULL;
uint32_t diam_err;
ogs_nas_5gs_message_t *nas_message = NULL;
ogs_sbi_stream_t *stream = NULL;
@ -829,6 +832,24 @@ void smf_gsm_state_operational(ogs_fsm_t *s, smf_event_t *e)
}
break;
case SMF_EVT_GY_MESSAGE:
gy_message = e->gy_message;
ogs_assert(gy_message);
switch(gy_message->cmd_code) {
case OGS_DIAM_GY_CMD_CODE_CREDIT_CONTROL:
switch (gy_message->cc_request_type) {
case OGS_DIAM_GY_CC_REQUEST_TYPE_UPDATE_REQUEST:
ogs_assert(e->pfcp_xact);
diam_err = smf_gy_handle_cca_update_request(sess, gy_message, e->pfcp_xact);
if (diam_err != ER_DIAMETER_SUCCESS)
OGS_FSM_TRAN(s, smf_gsm_state_wait_pfcp_deletion);
break;
}
break;
}
break;
case OGS_EVENT_SBI_SERVER:
sbi_message = e->h.sbi.message;
ogs_assert(sbi_message);

View File

@ -149,7 +149,7 @@ uint32_t smf_gy_handle_cca_initial_request(
return ER_DIAMETER_SUCCESS;
}
void smf_gy_handle_cca_update_request(
uint32_t smf_gy_handle_cca_update_request(
smf_sess_t *sess, ogs_diam_gy_message_t *gy_message,
ogs_pfcp_xact_t *pfcp_xact)
{
@ -175,10 +175,8 @@ void smf_gy_handle_cca_update_request(
if (gy_message->result_code != ER_DIAMETER_SUCCESS) {
ogs_warn("Gy CCA Update Diameter failure: res=%u err=%u",
gy_message->result_code, *gy_message->err);
// TODO: generate new gtp_xact from sess here? */
//ogs_assert(OGS_OK ==
// smf_epc_pfcp_send_session_deletion_request(sess, gtp_xact));
return;
return gy_message->err ? *gy_message->err :
ER_DIAMETER_AUTHENTICATION_REJECTED;
}
bearer = smf_default_bearer_in_sess(sess);
@ -234,6 +232,7 @@ void smf_gy_handle_cca_update_request(
OGS_GTP1_CAUSE_REACTIACTION_REQUESTED);
ogs_assert(rv == OGS_OK);
}
return ER_DIAMETER_SUCCESS;
}
uint32_t smf_gy_handle_cca_termination_request(

View File

@ -30,7 +30,7 @@ extern "C" {
uint32_t smf_gy_handle_cca_initial_request(
smf_sess_t *sess, ogs_diam_gy_message_t *gy_message,
ogs_gtp_xact_t *gtp_xact);
void smf_gy_handle_cca_update_request(
uint32_t smf_gy_handle_cca_update_request(
smf_sess_t *sess, ogs_diam_gy_message_t *gy_message,
ogs_pfcp_xact_t *pfcp_xact);
uint32_t smf_gy_handle_cca_termination_request(

View File

@ -328,23 +328,7 @@ void smf_state_operational(ogs_fsm_t *s, smf_event_t *e)
switch(gy_message->cmd_code) {
case OGS_DIAM_GY_CMD_CODE_CREDIT_CONTROL:
switch(gy_message->cc_request_type) {
case OGS_DIAM_GY_CC_REQUEST_TYPE_INITIAL_REQUEST:
ogs_fsm_dispatch(&sess->sm, e);
break;
case OGS_DIAM_GY_CC_REQUEST_TYPE_UPDATE_REQUEST:
ogs_assert(e->pfcp_xact);
smf_gy_handle_cca_update_request(
sess, gy_message, e->pfcp_xact);
break;
case OGS_DIAM_GY_CC_REQUEST_TYPE_TERMINATION_REQUEST:
ogs_fsm_dispatch(&sess->sm, e);
break;
default:
ogs_error("Not implemented(%d)", gy_message->cc_request_type);
break;
}
ogs_fsm_dispatch(&sess->sm, e);
break;
case OGS_DIAM_GY_CMD_RE_AUTH:
smf_gy_handle_re_auth_request(sess, gy_message);