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
...@@ -2503,13 +2495,9 @@ bool smf_context::handle_service_request( ...@@ -2503,13 +2495,9 @@ bool smf_context::handle_service_request(
// 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"]
["contentId"] = N2_SM_CONTENT_ID;
json_data["n2InfoContainer"]["smInfo"]["n2InfoContent"]["ngapIeType"] =
"PDU_RES_SETUP_REQ"; // NGAP message
json_data["upCnxState"] = "ACTIVATING"; json_data["upCnxState"] = "ACTIVATING";
sm_context_resp.get()->res.set_json_data(json_data); sm_context_resp.get()->res.set_json_data(json_data);
...@@ -3526,11 +3514,8 @@ bool smf_context::handle_ho_preparation_request( ...@@ -3526,11 +3514,8 @@ bool smf_context::handle_ho_preparation_request(
// 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["n2InfoContainer"]["smInfo"]["n2InfoContent"]["ngapIeType"] =
"PDU_RES_SETUP_REQ"; // NGAP message
json_data["hoState"] = "PREPARING"; 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(
...@@ -5088,13 +5073,9 @@ void smf_context::send_pdu_session_update_response( ...@@ -5088,13 +5073,9 @@ void smf_context::send_pdu_session_update_response(
// 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"]
["contentId"] = N2_SM_CONTENT_ID;
json_data["n2InfoContainer"]["smInfo"]["n2InfoContent"]["ngapIeType"] =
"PDU_RES_SETUP_REQ"; // NGAP message
json_data["upCnxState"] = "ACTIVATING"; 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
...@@ -5146,13 +5127,8 @@ void smf_context::send_pdu_session_update_response( ...@@ -5146,13 +5127,8 @@ void smf_context::send_pdu_session_update_response(
// 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);
...@@ -5171,13 +5147,9 @@ void smf_context::send_pdu_session_update_response( ...@@ -5171,13 +5147,9 @@ void smf_context::send_pdu_session_update_response(
// 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"]
["contentId"] = N2_SM_CONTENT_ID;
json_data["n2InfoContainer"]["smInfo"]["n2InfoContent"]["ngapIeType"] =
"HANDOVER_CMD";
json_data["hoState"] = "PREPARED"; json_data["hoState"] = "PREPARED";
resp->res.set_json_data(json_data); resp->res.set_json_data(json_data);
...@@ -5261,27 +5233,16 @@ void smf_context::send_pdu_session_release_response( ...@@ -5261,27 +5233,16 @@ 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