Commit 8b65e80f authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Remove Mobile Reachable Timer when NAS signalling is established

parent 6cc84963
......@@ -489,6 +489,8 @@ void amf_n1::nas_signalling_establishment_request_handle(
nc.get()->amf_ue_ngap_id = amf_ue_ngap_id;
nc.get()->ran_ue_ngap_id = ran_ue_ngap_id;
nc.get()->serving_network = snn;
// stop Mobile Reachable Timer
itti_inst->timer_remove(nc.get()->mobile_reachable_timer);
// stacs.UE_connected += 1;
// Trigger UE Reachability Status Notify
......@@ -675,6 +677,8 @@ void amf_n1::identity_response_handle(
nc.get()->imsi = supi;
supi2amfId[("imsi-" + nc.get()->imsi)] = amf_ue_ngap_id;
supi2ranId[("imsi-" + nc.get()->imsi)] = ran_ue_ngap_id;
// stop Mobile Reachable Timer
itti_inst->timer_remove(nc.get()->mobile_reachable_timer);
if (nc.get()->to_be_register_by_new_suci) {
run_registration_procedure(nc);
}
......@@ -928,6 +932,8 @@ void amf_n1::registration_request_handle(
nc.get()->amf_ue_ngap_id = amf_ue_ngap_id;
nc.get()->ran_ue_ngap_id = ran_ue_ngap_id;
nc.get()->serving_network = snn;
// stop Mobile Reachable Timer
itti_inst->timer_remove(nc.get()->mobile_reachable_timer);
}
nc.get()->is_imsi_present = true;
nc.get()->imsi = imsi.mcc + imsi.mnc + imsi.msin;
......@@ -1013,6 +1019,8 @@ void amf_n1::registration_request_handle(
// nc.get()->imsi =
// supi2amfId[("imsi-"+nc.get()->imsi)] = amf_ue_ngap_id;
// supi2ranId[("imsi-"+nc.get()->imsi)] = ran_ue_ngap_id;
// stop Mobile Reachable Timer
itti_inst->timer_remove(nc.get()->mobile_reachable_timer);
}
} break;
......@@ -3198,6 +3206,13 @@ void amf_n1::mobile_reachable_timer_timeout(
// TODO: Start the implicit de-registration timer
}
//------------------------------------------------------------------------------
void amf_n1::set_mobile_reachable_timer(
std::shared_ptr<nas_context>& nc, const timer_id_t& t) {
std::unique_lock lock(m_nas_context);
nc.get()->mobile_reachable_timer = t;
}
//------------------------------------------------------------------------------
void amf_n1::set_mobile_reachable_timer_timeout(
std::shared_ptr<nas_context>& nc, const bool& b) {
......
......@@ -192,6 +192,8 @@ class amf_n1 {
const std::shared_ptr<nas_context>& nc, bool& b) const;
bool get_mobile_reachable_timer_timeout(
const std::shared_ptr<nas_context>& nc) const;
void set_mobile_reachable_timer(
std::shared_ptr<nas_context>& nc, const timer_id_t& t);
private:
void ue_initiate_de_registration_handle(
......
......@@ -1296,6 +1296,7 @@ void amf_n2::handle_itti_message(itti_ue_context_release_complete& itti_msg) {
MOBILE_REACHABLE_TIMER_NO_EMERGENCY_SERVICES_MIN * 60, 0, TASK_AMF_N1,
TASK_AMF_MOBILE_REACHABLE_TIMER_EXPIRE, amf_ue_ngap_id);
Logger::amf_app().startup("Started mobile reachable timer ( tid %d)", tid);
amf_n1_inst->set_mobile_reachable_timer(nc, tid);
amf_n1_inst->set_mobile_reachable_timer_timeout(nc, false);
// TODO: User Location Information IE
......
......@@ -66,6 +66,7 @@ nas_context::nas_context() : _vector(), _5g_he_av(), _5g_av(), kamf() {
ueSecurityCaplen = 0;
nas_status = CM_IDLE;
is_mobile_reachable_timer_timeout = false;
mobile_reachable_timer = ITTI_INVALID_TIMER_ID;
}
//------------------------------------------------------------------------------
......
......@@ -37,6 +37,7 @@
#include "nas_security_context.hpp"
#include "security_def.hpp"
#include "struct.hpp"
#include "itti.hpp"
typedef enum {
_5GMM_STATE_MIN = 0,
......@@ -72,6 +73,7 @@ class nas_context {
cm_state_t nas_status;
_5gmm_state_t _5gmm_state;
bool is_mobile_reachable_timer_timeout;
timer_id_t mobile_reachable_timer;
// parameters from Registration request
uint8_t registration_type : 3;
......
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