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