From 04d5676db027fbec32ef2d55b93c3e1b6339de6b Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Fri, 16 Mar 2018 12:55:58 +0000 Subject: [PATCH] Fixed bug to save UE ctx on the mme_ue_s1ap_id_map upon reception of the service request. Service request is now working again for the case where the UE is ECM-IDLE. --- srsepc/src/mme/mme_gtpc.cc | 3 +++ srsepc/src/mme/s1ap_nas_transport.cc | 3 +++ 2 files changed, 6 insertions(+) diff --git a/srsepc/src/mme/mme_gtpc.cc b/srsepc/src/mme/mme_gtpc.cc index e1a172600..c5698af95 100644 --- a/srsepc/src/mme/mme_gtpc.cc +++ b/srsepc/src/mme/mme_gtpc.cc @@ -222,6 +222,9 @@ mme_gtpc::handle_create_session_response(srslte::gtpc_pdu *cs_resp_pdu) ue_emm_ctx_t *emm_ctx = &ue_ctx->emm_ctx; ue_ecm_ctx_t *ecm_ctx = &ue_ctx->ecm_ctx; + //Save UE IP to nas ctxt + emm_ctx->ue_ip.s_addr = cs_resp->paa.ipv4; + m_mme_gtpc_log->console("SPGW Allocated IP %s to ISMI %015lu",inet_ntoa(emm_ctx->ue_ip),emm_ctx->imsi); //Save SGW ctrl F-TEID in GTP-C context std::map::iterator it_g = m_imsi_to_gtpc_ctx.find(imsi); if(it_g == m_imsi_to_gtpc_ctx.end()) diff --git a/srsepc/src/mme/s1ap_nas_transport.cc b/srsepc/src/mme/s1ap_nas_transport.cc index 103d9f492..1eece94a4 100644 --- a/srsepc/src/mme/s1ap_nas_transport.cc +++ b/srsepc/src/mme/s1ap_nas_transport.cc @@ -712,6 +712,9 @@ s1ap_nas_transport::handle_nas_service_request(uint32_t m_tmsi, liblte_security_generate_k_enb(emm_ctx->security_ctxt.k_asme, emm_ctx->security_ctxt.ul_nas_count, emm_ctx->security_ctxt.k_enb); m_s1ap_log->info("Generating KeNB with UL NAS COUNT: %d\n",emm_ctx->security_ctxt.ul_nas_count); m_s1ap_log->console("UE Ctr TEID %d\n", emm_ctx->sgw_ctrl_fteid.teid); + + //Save UE ctx to MME UE S1AP id + m_s1ap->add_ue_ctx_to_mme_ue_s1ap_id_map(ue_ctx); m_s1ap->m_s1ap_ctx_mngmt_proc->send_initial_context_setup_request(emm_ctx, ecm_ctx,&ecm_ctx->erabs_ctx[5]); } else