Commit 7af3fc9f authored by Tien Thinh NGUYEN's avatar Tien Thinh NGUYEN

Fix issue for PDU session context update response

parent 889ce79c
......@@ -4915,6 +4915,7 @@ bool smf_context::check_handover_possibility(
return true;
}
//------------------------------------------------------------------------------
void smf_context::send_pdu_session_create_response(
const std::shared_ptr<itti_n11_create_sm_context_response>& resp) {
// fill content for N1N2MessageTransfer (including N1, N2 SM)
......@@ -5034,6 +5035,7 @@ void smf_context::send_pdu_session_create_response(
}
}
//------------------------------------------------------------------------------
// TODO refactor: Break down this function and split logic (e.g. setting PDU
// session values) from actual response, we should only need resp here
void smf_context::send_pdu_session_update_response(
......@@ -5050,7 +5052,8 @@ void smf_context::send_pdu_session_update_response(
// TODO: Optional: send ITTI message to N10 to trigger UDM registration
// (Nudm_UECM_Registration) see TS29503_Nudm_UECM.yaml (
// /{ueId}/registrations/smf-registrations/{pduSessionId}:)
if (resp->res.get_cause() !=
static_cast<uint8_t>(cause_value_5gsm_e::CAUSE_255_REQUEST_ACCEPTED)) {
switch (session_procedure_type) {
// PDU Session Establishment UE-Requested
case session_management_procedures_type_e::
......@@ -5130,14 +5133,16 @@ void smf_context::send_pdu_session_update_response(
case session_management_procedures_type_e::
PDU_SESSION_MODIFICATION_UE_INITIATED_STEP2: {
// No need to create N1/N2 Container
Logger::smf_app().info("PDU Session Modification UE-initiated (Step 2)");
Logger::smf_app().info(
"PDU Session Modification UE-initiated (Step 2)");
} break;
// PDU Session Modification UE-initiated (Step 3)
case session_management_procedures_type_e::
PDU_SESSION_MODIFICATION_UE_INITIATED_STEP3: {
// No need to create N1/N2 Container
Logger::smf_app().info("PDU Session Modification UE-initiated (Step 3)");
Logger::smf_app().info(
"PDU Session Modification UE-initiated (Step 3)");
// TODO: To be completed
} break;
......@@ -5151,13 +5156,14 @@ void smf_context::send_pdu_session_update_response(
// N1 SM
smf_n1::get_instance().create_n1_pdu_session_release_command(
resp->res, n1_sm_msg,
cause_value_5gsm_e::CAUSE_26_INSUFFICIENT_RESOURCES); // TODO: check
cause_value_5gsm_e::CAUSE_26_INSUFFICIENT_RESOURCES); // TODO:
// check
// Cause
conv::convert_string_2_hex(n1_sm_msg, n1_sm_msg_hex);
resp->res.set_n1_sm_message(n1_sm_msg_hex);
// include N2 SM Resource Release Request only when User Plane connection
// is activated
// include N2 SM Resource Release Request only when User Plane
// connection is activated
if (sps->get_upCnx_state() == upCnx_state_e::UPCNX_STATE_ACTIVATED) {
// N2 SM Information
smf_n2::get_instance()
......@@ -5186,7 +5192,8 @@ void smf_context::send_pdu_session_update_response(
} else {
// fill the content of SmContextUpdatedData
nlohmann::json json_data = {};
json_data["n1MessageContainer"]["n1MessageClass"] = N1N2_MESSAGE_CLASS;
json_data["n1MessageContainer"]["n1MessageClass"] =
N1N2_MESSAGE_CLASS;
json_data["n1MessageContainer"]["n1MessageContent"]["contentId"] =
N1_SM_CONTENT_ID;
resp->res.set_json_data(json_data);
......@@ -5267,7 +5274,8 @@ void smf_context::send_pdu_session_update_response(
} break;
case session_management_procedures_type_e::N2_HO_PREPARATION_PHASE_STEP2: {
case session_management_procedures_type_e::
N2_HO_PREPARATION_PHASE_STEP2: {
// Create N2 SM Information: Handover Command Transfer IE
// N2 SM Information
......@@ -5298,6 +5306,10 @@ void smf_context::send_pdu_session_update_response(
"Unknown session procedure type %d", session_procedure_type);
}
}
} else {
resp->res.set_http_code(
http_status_code_e::HTTP_STATUS_CODE_406_NOT_ACCEPTABLE);
}
// send ITTI message to SMF_APP interface to trigger
// SessionUpdateSMContextResponse towards AMFs
......@@ -5320,6 +5332,7 @@ void smf_context::send_pdu_session_update_response(
// see step 17@section 4.3.2.2.1@3GPP TS 23.502
}
//------------------------------------------------------------------------------
void smf_context::send_pdu_session_release_response(
const std::shared_ptr<itti_n11_release_sm_context_request>& req,
const std::shared_ptr<itti_n11_release_sm_context_response>& resp,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment