Commit adbd592f authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen
Browse files

Remove unnecessary ITTI to send HTTP response

parent 7b7ea0b4
......@@ -1757,9 +1757,10 @@ void smf_app::trigger_create_context_error_response(
refToBinaryData.setContentId(N1_SM_CONTENT_ID);
sm_context.setN1SmMsg(refToBinaryData);
std::shared_ptr<itti_n11_create_sm_context_response> itti_msg =
std::make_shared<itti_n11_create_sm_context_response>(
TASK_SMF_SBI, TASK_SMF_APP, promise_id);
/* std::shared_ptr<itti_n11_create_sm_context_response> itti_msg =
std::make_shared<itti_n11_create_sm_context_response>(
TASK_SMF_SBI, TASK_SMF_APP, promise_id);
*/
pdu_session_create_sm_context_response sm_context_response = {};
nlohmann::json json_data = {};
to_json(json_data, sm_context);
......@@ -1767,13 +1768,15 @@ void smf_app::trigger_create_context_error_response(
sm_context_response.set_json_format("application/problem+json");
sm_context_response.set_n1_sm_message(n1_sm_msg);
sm_context_response.set_http_code(http_code);
itti_msg->res = sm_context_response;
trigger_session_create_sm_context_response(sm_context_response, promise_id);
/*itti_msg->res = sm_context_response;
int ret = itti_inst->send_msg(itti_msg);
if (RETURNok != ret) {
Logger::smf_app().error(
"Could not send ITTI message %s to task TASK_SMF_APP",
itti_msg->get_msg_name());
}
}*/
}
//---------------------------------------------------------------------------------------------
......@@ -1787,22 +1790,25 @@ void smf_app::trigger_update_context_error_response(
problem_details.setCause(pdu_session_application_error_e2str.at(cause));
smContextUpdateError.setError(problem_details);
std::shared_ptr<itti_n11_update_sm_context_response> itti_msg =
/*std::shared_ptr<itti_n11_update_sm_context_response> itti_msg =
std::make_shared<itti_n11_update_sm_context_response>(
TASK_SMF_SBI, TASK_SMF_APP, promise_id);
*/
pdu_session_update_sm_context_response sm_context_response = {};
nlohmann::json json_data = {};
to_json(json_data, smContextUpdateError);
sm_context_response.set_json_data(json_data);
sm_context_response.set_json_format("application/problem+json");
sm_context_response.set_http_code(http_code);
itti_msg->res = sm_context_response;
trigger_session_update_sm_context_response(sm_context_response, promise_id);
/*itti_msg->res = sm_context_response;
int ret = itti_inst->send_msg(itti_msg);
if (RETURNok != ret) {
Logger::smf_app().error(
"Could not send ITTI message %s to task TASK_SMF_APP",
itti_msg->get_msg_name());
}
}*/
}
//---------------------------------------------------------------------------------------------
......@@ -1817,9 +1823,10 @@ void smf_app::trigger_update_context_error_response(
problem_details.setCause(pdu_session_application_error_e2str.at(cause));
smContextUpdateError.setError(problem_details);
std::shared_ptr<itti_n11_update_sm_context_response> itti_msg =
std::make_shared<itti_n11_update_sm_context_response>(
TASK_SMF_SBI, TASK_SMF_APP, promise_id);
/* std::shared_ptr<itti_n11_update_sm_context_response> itti_msg =
std::make_shared<itti_n11_update_sm_context_response>(
TASK_SMF_SBI, TASK_SMF_APP, promise_id);
*/
pdu_session_update_sm_context_response sm_context_response = {};
nlohmann::json json_data = {};
to_json(json_data, smContextUpdateError);
......@@ -1827,13 +1834,15 @@ void smf_app::trigger_update_context_error_response(
sm_context_response.set_json_format("application/problem+json");
sm_context_response.set_n1_sm_message(n1_sm_msg);
sm_context_response.set_http_code(http_code);
itti_msg->res = sm_context_response;
trigger_session_update_sm_context_response(sm_context_response, promise_id);
/*itti_msg->res = sm_context_response;
int ret = itti_inst->send_msg(itti_msg);
if (RETURNok != ret) {
Logger::smf_app().error(
"Could not send ITTI message %s to task TASK_SMF_APP",
itti_msg->get_msg_name());
}
}*/
}
//---------------------------------------------------------------------------------------------
......
......@@ -1520,10 +1520,10 @@ void smf_context::handle_pdu_session_create_sm_context_request(
// 5, 4.3.2.2.1 TS 23.502)
Logger::smf_app().debug(
"Send ITTI msg to SMF APP to trigger the response of Server");
std::shared_ptr<itti_n11_create_sm_context_response> itti_msg =
std::make_shared<itti_n11_create_sm_context_response>(
TASK_SMF_SBI, TASK_SMF_APP, smreq->pid);
/* std::shared_ptr<itti_n11_create_sm_context_response> itti_msg =
std::make_shared<itti_n11_create_sm_context_response>(
TASK_SMF_SBI, TASK_SMF_APP, smreq->pid);
*/
pdu_session_create_sm_context_response sm_context_response = {};
std::string smContextRef = std::to_string(smreq->scid);
// headers: Location: contains the URI of the newly created resource,
......@@ -1540,6 +1540,11 @@ void smf_context::handle_pdu_session_create_sm_context_request(
sm_context_response.set_json_data(json_data);
sm_context_response.set_http_code(
http_status_code_e::HTTP_STATUS_CODE_201_CREATED);
smf_app_inst->trigger_session_create_sm_context_response(
sm_context_response, smreq->pid);
/*
itti_msg->res = sm_context_response;
int ret = itti_inst->send_msg(itti_msg);
......@@ -1548,6 +1553,7 @@ void smf_context::handle_pdu_session_create_sm_context_request(
"Could not send ITTI message %s to task TASK_SMF_APP",
itti_msg->get_msg_name());
}
*/
// TODO: PDU Session authentication/authorization (Optional)
// see section 4.3.2.3@3GPP TS 23.502 and section 6.3.1@3GPP TS 24.501
......
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