Commit 1b9cc756 authored by aligungr's avatar aligungr

Service reject handling

parent f1442d1c
......@@ -106,7 +106,7 @@ void NasMm::performMmCycle()
if (m_mmSubState == EMmSubState::MM_DEREGISTERED_NORMAL_SERVICE)
{
if (!m_timers->t3346.isRunning())
sendInitialRegistration(false, false);
sendInitialRegistration(EInitialRegCause::MM_DEREG_NORMAL_SERVICE);
return;
}
......
......@@ -91,7 +91,7 @@ class NasMm
void sendMobilityRegistration(ERegUpdateCause updateCause);
private: /* Registration */
void sendInitialRegistration(bool isEmergencyReg, bool dueToDereg);
void sendInitialRegistration(EInitialRegCause regCause);
void receiveRegistrationAccept(const nas::RegistrationAccept &msg);
void receiveInitialRegistrationAccept(const nas::RegistrationAccept &msg);
void receiveMobilityRegistrationAccept(const nas::RegistrationAccept &msg);
......
......@@ -16,7 +16,7 @@
namespace nr::ue
{
void NasMm::sendInitialRegistration(bool isEmergencyReg, bool dueToDereg)
void NasMm::sendInitialRegistration(EInitialRegCause regCause)
{
if (m_rmState != ERmState::RM_DEREGISTERED)
{
......@@ -24,6 +24,8 @@ void NasMm::sendInitialRegistration(bool isEmergencyReg, bool dueToDereg)
return;
}
bool isEmergencyReg = regCause == EInitialRegCause::EMERGENCY_SERVICES;
// 5.5.1.2.7 Abnormal cases in the UE
// a) Timer T3346 is running.
if (m_timers->t3346.isRunning() && !isEmergencyReg && !hasEmergency())
......@@ -33,7 +35,7 @@ void NasMm::sendInitialRegistration(bool isEmergencyReg, bool dueToDereg)
bool highPriority = isHighPriority();
// The UE shall not start the registration procedure for initial registration in the following case
if (!highPriority && !dueToDereg)
if (!highPriority && regCause != EInitialRegCause::DUE_TO_DEREGISTRATION)
{
m_logger->debug("Initial registration canceled, T3346 is running");
return;
......
......@@ -327,17 +327,13 @@ void NasMm::receiveServiceReject(const nas::ServiceReject &msg)
if (cause == nas::EMmCause::UE_IDENTITY_CANNOT_BE_DERIVED_FROM_NETWORK)
{
if (m_lastServiceReqCause != EServiceReqCause::EMERGENCY_FALLBACK)
{
// TODO: new initial registration
}
sendInitialRegistration(EInitialRegCause::DUE_TO_SERVICE_REJECT);
}
if (cause == nas::EMmCause::IMPLICITY_DEREGISTERED)
{
if (hasEmergency())
{
// TODO: new initial registration
}
if (!hasEmergency())
sendInitialRegistration(EInitialRegCause::DUE_TO_SERVICE_REJECT);
}
if (cause == nas::EMmCause::CONGESTION)
......
......@@ -29,7 +29,7 @@ void NasMm::onTimerExpire(nas::NasTimer &timer)
if (m_mmSubState == EMmSubState::MM_DEREGISTERED_NORMAL_SERVICE)
{
logExpired();
sendInitialRegistration(false, false);
sendInitialRegistration(EInitialRegCause::T3346_EXPIRY);
}
break;
}
......
......@@ -119,6 +119,16 @@ enum class EDeregCause
ECALL_INACTIVITY,
};
enum class EInitialRegCause
{
UNSPECIFIED,
EMERGENCY_SERVICES,
MM_DEREG_NORMAL_SERVICE,
T3346_EXPIRY,
DUE_TO_DEREGISTRATION,
DUE_TO_SERVICE_REJECT,
};
struct GlobalNci
{
Plmn plmn{};
......
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