Commit ce381e8b authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Fix issue for PDU Session Release

parent f8e7915c
...@@ -220,10 +220,13 @@ void IndividualSMContextApiImpl::update_sm_context( ...@@ -220,10 +220,13 @@ void IndividualSMContextApiImpl::update_sm_context(
response.headers().add<Pistache::Http::Header::ContentType>( response.headers().add<Pistache::Http::Header::ContentType>(
Pistache::Http::Mime::MediaType( Pistache::Http::Mime::MediaType(
"multipart/related; boundary=" + std::string(CURL_MIME_BOUNDARY))); "multipart/related; boundary=" + std::string(CURL_MIME_BOUNDARY)));
} else { } else if (json_data.size() > 0 ){
response.headers().add<Pistache::Http::Header::ContentType>( response.headers().add<Pistache::Http::Header::ContentType>(
Pistache::Http::Mime::MediaType("application/json")); Pistache::Http::Mime::MediaType("application/json"));
body = json_data.dump().c_str(); body = json_data.dump().c_str();
} else {
response.send(Pistache::Http::Code(sm_context_response.get_http_code()));
return;
} }
response.send(Pistache::Http::Code(sm_context_response.get_http_code()), response.send(Pistache::Http::Code(sm_context_response.get_http_code()),
......
...@@ -777,6 +777,7 @@ void smf_app::handle_pdu_session_create_sm_context_request( ...@@ -777,6 +777,7 @@ void smf_app::handle_pdu_session_create_sm_context_request(
//Step 4. Verify the session is already existed //Step 4. Verify the session is already existed
if (is_scid_2_smf_context(supi64, dnn, snssai, pdu_session_id)) { if (is_scid_2_smf_context(supi64, dnn, snssai, pdu_session_id)) {
//TODO: should delete the local context (including and any associated resources in the UPF and PCF) and create a new one
Logger::smf_app().warn( Logger::smf_app().warn(
"PDU Session already existed (SUPI " SUPI_64_FMT ", DNN %s, NSSAI (sst %d, sd %s), PDU Session ID %d)", "PDU Session already existed (SUPI " SUPI_64_FMT ", DNN %s, NSSAI (sst %d, sd %s), PDU Session ID %d)",
supi64, dnn.c_str(), snssai.sST, snssai.sD.c_str(), pdu_session_id); supi64, dnn.c_str(), snssai.sST, snssai.sD.c_str(), pdu_session_id);
......
...@@ -1220,14 +1220,14 @@ void smf_context::handle_pdu_session_create_sm_context_request( ...@@ -1220,14 +1220,14 @@ void smf_context::handle_pdu_session_create_sm_context_request(
bool find_pdu = sd.get()->find_pdu_session(pdu_session_id, sp); bool find_pdu = sd.get()->find_pdu_session(pdu_session_id, sp);
if (nullptr == sp.get()) { if (nullptr == sp.get()) {
Logger::smf_app().debug("Create a new PDN connection"); Logger::smf_app().debug("Create a new PDU session");
sp = std::shared_ptr<smf_pdu_session>(new smf_pdu_session()); sp = std::shared_ptr<smf_pdu_session>(new smf_pdu_session());
sp.get()->pdn_type.pdn_type = smreq->req.get_pdu_session_type(); sp.get()->pdn_type.pdn_type = smreq->req.get_pdu_session_type();
sp.get()->pdu_session_id = pdu_session_id; sp.get()->pdu_session_id = pdu_session_id;
sp.get()->amf_id = smreq->req.get_serving_nf_id(); //amf id sp.get()->amf_id = smreq->req.get_serving_nf_id(); //amf id
sd->insert_pdu_session(sp); sd->insert_pdu_session(sp);
} else { } else {
Logger::smf_app().debug("PDN connection is already existed!"); Logger::smf_app().debug("PDU session is already existed!");
//trigger to send reply to AMF //trigger to send reply to AMF
smf_app_inst->trigger_http_response( smf_app_inst->trigger_http_response(
http_status_code_e::HTTP_STATUS_CODE_406_NOT_ACCEPTABLE, smreq->pid, http_status_code_e::HTTP_STATUS_CODE_406_NOT_ACCEPTABLE, smreq->pid,
...@@ -2317,6 +2317,9 @@ void smf_context::handle_pdu_session_update_sm_context_request( ...@@ -2317,6 +2317,9 @@ void smf_context::handle_pdu_session_update_sm_context_request(
sm_context_resp_pending->session_procedure_type = procedure_type; sm_context_resp_pending->session_procedure_type = procedure_type;
//don't need to create a procedure to update UPF //don't need to create a procedure to update UPF
smf_app_inst->trigger_http_response(
http_status_code_e::HTTP_STATUS_CODE_200_OK,
smreq->pid, N11_SESSION_UPDATE_SM_CONTEXT_RESPONSE);
} }
break; break;
......
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