Commit d8dd47e8 authored by Tien Thinh NGUYEN's avatar Tien Thinh NGUYEN

Fix N1N2 Content msg

parent 322e3ddc
...@@ -1950,19 +1950,11 @@ bool smf_context::handle_pdu_session_modification_request( ...@@ -1950,19 +1950,11 @@ bool smf_context::handle_pdu_session_modification_request(
n2_sm_info_hex_to_be_created); n2_sm_info_hex_to_be_created);
sm_context_resp.get()->res.set_n2_sm_info_type("PDU_RES_MOD_REQ"); sm_context_resp.get()->res.set_n2_sm_info_type("PDU_RES_MOD_REQ");
// Fill the json part // Fill the json part with SmContextUpdatedData
nlohmann::json json_data = {}; nlohmann::json json_data = {};
// N1SM json_data["n1SmMsg"]["contentId"] = N1_SM_CONTENT_ID;
json_data["n1MessageContainer"]["n1MessageClass"] = N1N2_MESSAGE_CLASS; json_data["n2SmInfo"]["contentId"] = N2_SM_CONTENT_ID;
json_data["n1MessageContainer"]["n1MessageContent"]["contentId"] = json_data["n2SmInfoType"] = "PDU_RES_MOD_REQ"; // NGAP message
N1_SM_CONTENT_ID;
json_data["n2InfoContainer"]["n2InformationClass"] = N1N2_MESSAGE_CLASS;
json_data["n2InfoContainer"]["smInfo"]["n2InfoContent"]["ngapIeType"] =
"PDU_RES_MOD_REQ"; // NGAP message
json_data["n2InfoContainer"]["smInfo"]["n2InfoContent"]["ngapData"]
["contentId"] = N2_SM_CONTENT_ID;
json_data["n2InfoContainer"]["smInfo"]["PduSessionId"] =
sm_context_resp.get()->res.get_pdu_session_id();
sm_context_resp.get()->res.set_json_data(json_data); sm_context_resp.get()->res.set_json_data(json_data);
// Update PDU Session status // Update PDU Session status
...@@ -2502,15 +2494,11 @@ bool smf_context::handle_service_request( ...@@ -2502,15 +2494,11 @@ bool smf_context::handle_service_request(
sm_context_resp.get()->res.set_n2_sm_information(n2_sm_info_hex); sm_context_resp.get()->res.set_n2_sm_information(n2_sm_info_hex);
// fill the content of SmContextUpdatedData // fill the content of SmContextUpdatedData
nlohmann::json json_data = {}; nlohmann::json json_data = {};
json_data["n2InfoContainer"]["n2InformationClass"] = N1N2_MESSAGE_CLASS;
json_data["n2InfoContainer"]["smInfo"]["PduSessionId"] = json_data["n2SmInfo"]["contentId"] = N2_SM_CONTENT_ID;
sm_context_resp.get()->res.get_pdu_session_id(); json_data["n2SmInfoType"] = "PDU_RES_SETUP_REQ"; // NGAP message
json_data["n2InfoContainer"]["smInfo"]["n2InfoContent"]["ngapData"] json_data["upCnxState"] = "ACTIVATING";
["contentId"] = N2_SM_CONTENT_ID;
json_data["n2InfoContainer"]["smInfo"]["n2InfoContent"]["ngapIeType"] =
"PDU_RES_SETUP_REQ"; // NGAP message
json_data["upCnxState"] = "ACTIVATING";
sm_context_resp.get()->res.set_json_data(json_data); sm_context_resp.get()->res.set_json_data(json_data);
// Update upCnxState to ACTIVATING // Update upCnxState to ACTIVATING
...@@ -3525,13 +3513,10 @@ bool smf_context::handle_ho_preparation_request( ...@@ -3525,13 +3513,10 @@ bool smf_context::handle_ho_preparation_request(
sm_context_resp.get()->res.set_n2_sm_information(n2_sm_info_hex); sm_context_resp.get()->res.set_n2_sm_information(n2_sm_info_hex);
// Fill the content of SmContextUpdatedData // Fill the content of SmContextUpdatedData
nlohmann::json json_data = {}; nlohmann::json json_data = {};
json_data["n2InfoContainer"]["n2InformationClass"] = N1N2_MESSAGE_CLASS; json_data["n2SmInfo"]["contentId"] = N2_SM_CONTENT_ID;
json_data["n2InfoContainer"]["smInfo"]["n2InfoContent"]["ngapData"] json_data["n2SmInfoType"] = "PDU_RES_SETUP_REQ"; // NGAP message
["contentId"] = N2_SM_CONTENT_ID; json_data["hoState"] = "PREPARING";
json_data["n2InfoContainer"]["smInfo"]["n2InfoContent"]["ngapIeType"] =
"PDU_RES_SETUP_REQ"; // NGAP message
json_data["hoState"] = "PREPARING";
sm_context_resp.get()->res.set_json_data(json_data); sm_context_resp.get()->res.set_json_data(json_data);
sm_context_resp.get()->res.set_http_code( sm_context_resp.get()->res.set_http_code(
http_status_code_e::HTTP_STATUS_CODE_200_OK); http_status_code_e::HTTP_STATUS_CODE_200_OK);
...@@ -5087,15 +5072,11 @@ void smf_context::send_pdu_session_update_response( ...@@ -5087,15 +5072,11 @@ void smf_context::send_pdu_session_update_response(
resp->res.set_n2_sm_information(n2_sm_info_hex); resp->res.set_n2_sm_information(n2_sm_info_hex);
// fill the content of SmContextUpdatedData // fill the content of SmContextUpdatedData
nlohmann::json json_data = {}; nlohmann::json json_data = {};
json_data["n2InfoContainer"]["n2InformationClass"] = N1N2_MESSAGE_CLASS;
json_data["n2InfoContainer"]["smInfo"]["PduSessionId"] = json_data["n2SmInfo"]["contentId"] = N2_SM_CONTENT_ID;
resp->res.get_pdu_session_id(); json_data["n2SmInfoType"] = "PDU_RES_SETUP_REQ"; // NGAP message
json_data["n2InfoContainer"]["smInfo"]["n2InfoContent"]["ngapData"] json_data["upCnxState"] = "ACTIVATING";
["contentId"] = N2_SM_CONTENT_ID;
json_data["n2InfoContainer"]["smInfo"]["n2InfoContent"]["ngapIeType"] =
"PDU_RES_SETUP_REQ"; // NGAP message
json_data["upCnxState"] = "ACTIVATING";
resp->res.set_json_data(json_data); resp->res.set_json_data(json_data);
// TODO: verify whether cause is needed (as in 23.502 but not in 3GPP // TODO: verify whether cause is needed (as in 23.502 but not in 3GPP
// TS 29.502) // TS 29.502)
...@@ -5145,14 +5126,9 @@ void smf_context::send_pdu_session_update_response( ...@@ -5145,14 +5126,9 @@ void smf_context::send_pdu_session_update_response(
resp->res.set_n2_sm_information(n2_sm_info_hex); resp->res.set_n2_sm_information(n2_sm_info_hex);
// fill the content of SmContextUpdatedData // fill the content of SmContextUpdatedData
nlohmann::json json_data = {}; nlohmann::json json_data = {};
json_data["n2InfoContainer"]["n2InformationClass"] = N1N2_MESSAGE_CLASS; json_data["n2SmInfo"]["contentId"] = N2_SM_CONTENT_ID;
json_data["n2InfoContainer"]["smInfo"]["PduSessionId"] = json_data["n2SmInfoType"] = "PATH_SWITCH_REQ_ACK"; // NGAP message
resp->res.get_pdu_session_id();
json_data["n2InfoContainer"]["smInfo"]["n2InfoContent"]["ngapData"]
["contentId"] = N2_SM_CONTENT_ID;
json_data["n2InfoContainer"]["smInfo"]["n2InfoContent"]["ngapIeType"] =
"PATH_SWITCH_REQ_ACK";
// NGAP message json_data["upCnxState"] ="ACTIVATING"; // NGAP message json_data["upCnxState"] ="ACTIVATING";
resp->res.set_json_data(json_data); resp->res.set_json_data(json_data);
...@@ -5170,15 +5146,11 @@ void smf_context::send_pdu_session_update_response( ...@@ -5170,15 +5146,11 @@ void smf_context::send_pdu_session_update_response(
resp->res.set_n2_sm_information(n2_sm_info_hex); resp->res.set_n2_sm_information(n2_sm_info_hex);
// fill the content of SmContextUpdatedData // fill the content of SmContextUpdatedData
nlohmann::json json_data = {}; nlohmann::json json_data = {};
json_data["n2InfoContainer"]["n2InformationClass"] = N1N2_MESSAGE_CLASS;
json_data["n2InfoContainer"]["smInfo"]["PduSessionId"] = json_data["n2SmInfo"]["contentId"] = N2_SM_CONTENT_ID;
resp->res.get_pdu_session_id(); json_data["n2SmInfoType"] = "HANDOVER_CMD"; // NGAP message
json_data["n2InfoContainer"]["smInfo"]["n2InfoContent"]["ngapData"] json_data["hoState"] = "PREPARED";
["contentId"] = N2_SM_CONTENT_ID;
json_data["n2InfoContainer"]["smInfo"]["n2InfoContent"]["ngapIeType"] =
"HANDOVER_CMD";
json_data["hoState"] = "PREPARED";
resp->res.set_json_data(json_data); resp->res.set_json_data(json_data);
// Set HO State to prepared // Set HO State to prepared
...@@ -5260,28 +5232,17 @@ void smf_context::send_pdu_session_release_response( ...@@ -5260,28 +5232,17 @@ void smf_context::send_pdu_session_release_response(
// Prepare response to send to AMF // Prepare response to send to AMF
// (PDUSession_UpdateSMContextResponse) // (PDUSession_UpdateSMContextResponse)
nlohmann::json sm_context_response_data = {}; nlohmann::json sm_context_response_data = {};
sm_context_response_data["n1MessageContainer"]["n1MessageClass"] = sm_context_response_data["n1SmMsg"]["contentId"] = N1_SM_CONTENT_ID;
N1N2_MESSAGE_CLASS; sm_context_response_data["n2SmInfo"]["contentId"] = N2_SM_CONTENT_ID;
sm_context_response_data["n1MessageContainer"]["n1MessageContent"]
["contentId"] = N1_SM_CONTENT_ID;
sm_context_response_data["n2InfoContainer"]["n2InformationClass"] =
N1N2_MESSAGE_CLASS;
sm_context_response_data["n2InfoContainer"]["smInfo"]
["PduSessionId"] =
resp->res.get_pdu_session_id();
sm_context_response_data["n2InfoContainer"]["smInfo"]["n2InfoContent"]
["ngapData"]["contentId"] = N2_SM_CONTENT_ID;
sm_context_response_data["n2SmInfoType"] = sm_context_response_data["n2SmInfoType"] =
"PDU_RES_REL_CMD"; // NGAP message "PDU_RES_REL_CMD"; // NGAP message
resp->res.set_json_data(sm_context_response_data); resp->res.set_json_data(sm_context_response_data);
} else { } else {
// fill the content of SmContextUpdatedData // fill the content of SmContextUpdatedData
nlohmann::json json_data = {}; nlohmann::json json_data = {};
json_data["n1MessageContainer"]["n1MessageClass"] = json_data["n1SmMsg"]["contentId"] = N1_SM_CONTENT_ID;
N1N2_MESSAGE_CLASS;
json_data["n1MessageContainer"]["n1MessageContent"]["contentId"] =
N1_SM_CONTENT_ID;
resp->res.set_json_data(json_data); resp->res.set_json_data(json_data);
} }
......
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