srsEPC: Using bearer state to decide weather to send release bearer request or not.

master
Pedro Alvarez 5 years ago
parent 10050d2651
commit 163c078c42

@ -759,6 +759,11 @@ bool nas::handle_detach_request(uint32_t m_tmsi,
emm_ctx->state = EMM_STATE_DEREGISTERED;
sec_ctx->ul_nas_count++;
// Mark E-RABs as de-activated
for (esm_ctx_t& esm_ctx : nas_ctx->m_esm_ctx) {
esm_ctx.state = ERAB_DEACTIVATED;
}
nas_log->console("Received. M-TMSI 0x%x\n", m_tmsi);
// Received detach request as an initial UE message
// eNB created new ECM context to send the detach request; this needs to be cleared.
@ -1242,6 +1247,12 @@ bool nas::handle_detach_request(srslte::byte_buffer_t* nas_msg)
m_gtpc->send_delete_session_request(m_emm_ctx.imsi);
m_emm_ctx.state = EMM_STATE_DEREGISTERED;
// Mark E-RABs as de-activated
for (esm_ctx_t& esm_ctx : m_esm_ctx) {
esm_ctx.state = ERAB_DEACTIVATED;
}
if (m_ecm_ctx.mme_ue_s1ap_id != 0) {
m_s1ap->send_ue_context_release_command(m_ecm_ctx.mme_ue_s1ap_id);
}

@ -287,9 +287,18 @@ bool s1ap_ctx_mngmt_proc::send_ue_context_release_command(nas* nas_ctx, bool sen
return false;
}
// Detect weather there are active E-RABs
bool active_erabs = false;
for (esm_ctx_t& esm_ctx : nas_ctx->m_esm_ctx) {
if (esm_ctx.state != ERAB_DEACTIVATED) {
active_erabs = true;
break;
}
}
// On some circumstances, such as the NAS Detach, the UE context has already been cleared from
// the SPGW. In such cases, there is no need to send the GTP-C Release Access Bearers Request.
if (send_release_erabs) {
if (active_erabs) {
// There are active E-RABs, send release access mearers request
m_s1ap_log->console("There are active E-RABs, send release access bearers request\n");
m_s1ap_log->info("There are active E-RABs, send release access bearers request\n");
@ -299,7 +308,7 @@ bool s1ap_ctx_mngmt_proc::send_ue_context_release_command(nas* nas_ctx, bool sen
m_mme_gtpc->send_release_access_bearers_request(emm_ctx->imsi);
}
// Mark ECM state as IDLE
// Mark ECM state as IDLE and de-activate E-RABs
ecm_ctx->state = ECM_STATE_IDLE;
for (esm_ctx_t& esm_ctx : nas_ctx->m_esm_ctx) {
esm_ctx.state = ERAB_DEACTIVATED;

Loading…
Cancel
Save