Commit 4968a4f5 authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Fix issue for Service Request

parent a3ab8d23
......@@ -572,12 +572,26 @@ void amf_n1::service_request_handle(
std::unique_ptr<ServiceAccept> serApt = std::make_unique<ServiceAccept>();
serApt->setHeader(PLAIN_5GS_MSG);
string supi = "imsi-" + nc.get()->imsi;
uc.get()->supi = supi;
supi2amfId[supi] = amf_ue_ngap_id;
supi2ranId[supi] = ran_ue_ngap_id;
Logger::amf_n1().debug(
"amf_ue_ngap_id %d, ran_ue_ngap_id %d", amf_ue_ngap_id, ran_ue_ngap_id);
Logger::amf_n1().debug("Key for pdu session context: SUPI %s", supi.c_str());
// get the status of PDU Session context
std::shared_ptr<pdu_session_context> old_psc = {};
if (amf_app_inst->is_supi_2_ue_context(supi)) {
std::shared_ptr<ue_context> old_uc = {};
old_uc = amf_app_inst->supi_2_ue_context(supi);
uc->copy_pdu_sessions(old_uc);
amf_app_inst->set_supi_2_ue_context(supi, uc);
}
// associate SUPI with UC
amf_app_inst->set_supi_2_ue_context(supi, uc);
// get PDU session status
std::vector<uint8_t> pdu_session_to_be_activated = {};
std::bitset<16> pdu_session_status_bits((uint16_t) 0x0200);
......
......@@ -171,7 +171,7 @@ void amf_n11::handle_itti_message(
"ID %d)",
supi.c_str(), itti_msg.pdu_session_id);
std::shared_ptr<pdu_session_context> psc;
std::shared_ptr<pdu_session_context> psc = {};
if (!uc.get()->find_pdu_session_context(itti_msg.pdu_session_id, psc)) {
Logger::amf_n11().error(
"Could not find psu_session_context with SUPI %s, Failed",
......
......@@ -52,3 +52,7 @@ void ue_context::add_pdu_session_context(
std::unique_lock lock(m_pdu_session);
pdu_sessions[session_id] = context;
}
void ue_context::copy_pdu_sessions(std::shared_ptr<ue_context>& ue_ctx) {
pdu_sessions = ue_ctx->pdu_sessions;
}
......@@ -54,6 +54,7 @@ class ue_context {
void add_pdu_session_context(
const std::uint8_t& session_id,
const std::shared_ptr<pdu_session_context>& context);
void copy_pdu_sessions(std::shared_ptr<ue_context>& ue_ctx);
public:
uint32_t ran_ue_ngap_id; // 32bits
......
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