Commit 7f07f1df authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Remove UE context after receiving NGAP SHUTDOWN

parent 1b6e12d3
...@@ -417,10 +417,11 @@ void amf_n2::handle_itti_message(itti_ng_shutdown& itti_msg) { ...@@ -417,10 +417,11 @@ void amf_n2::handle_itti_message(itti_ng_shutdown& itti_msg) {
gc.get()->ng_state = NGAP_SHUTDOWN; gc.get()->ng_state = NGAP_SHUTDOWN;
// Release all the resources related to this interface // Release all the resources related to this interface
uint32_t ran_ue_ngap_id = 0;
for (auto ue_context : ranid2uecontext) { for (auto ue_context : ranid2uecontext) {
if (ue_context.second->gnb_assoc_id == itti_msg.assoc_id) { if (ue_context.second->gnb_assoc_id == itti_msg.assoc_id) {
uint32_t ran_ue_ngap_id = ue_context.second->ran_ue_ngap_id; ran_ue_ngap_id = ue_context.second->ran_ue_ngap_id;
long amf_ue_ngap_id = ue_context.second->amf_ue_ngap_id; long amf_ue_ngap_id = ue_context.second->amf_ue_ngap_id;
// get NAS context // get NAS context
std::shared_ptr<nas_context> nc; std::shared_ptr<nas_context> nc;
if (amf_n1_inst->is_amf_ue_id_2_nas_context(amf_ue_ngap_id)) { if (amf_n1_inst->is_amf_ue_id_2_nas_context(amf_ue_ngap_id)) {
...@@ -432,6 +433,10 @@ void amf_n2::handle_itti_message(itti_ng_shutdown& itti_msg) { ...@@ -432,6 +433,10 @@ void amf_n2::handle_itti_message(itti_ng_shutdown& itti_msg) {
} }
} }
} }
// remove UE context
if (ranid2uecontext.count(ran_ue_ngap_id) > 0) {
ranid2uecontext.erase(ran_ue_ngap_id);
}
// Delete gNB context // Delete gNB context
remove_gnb_context(itti_msg.assoc_id); remove_gnb_context(itti_msg.assoc_id);
......
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