Changing Delete session request to delete GTP-C context.

master
Pedro Alvarez 7 years ago
parent ef4ad0aa20
commit 3b338067c9

@ -56,7 +56,7 @@ public:
void handle_create_session_response(srslte::gtpc_pdu *cs_resp_pdu, bool pack_attach);
void send_modify_bearer_request(uint64_t imsi, erab_ctx_t *bearer_ctx);
void handle_modify_bearer_response(srslte::gtpc_pdu *mb_resp_pdu);
void send_delete_session_request(ue_ecm_ctx_t *ue_ecm_ctx);
void send_delete_session_request(uint64_t imsi);
private:

@ -307,28 +307,47 @@ mme_gtpc::send_delete_session_request(uint64_t imsi)
{
m_mme_gtpc_log->info("Sending GTP-C Delete Session Request request. IMSI %d\n",imsi);
srslte::gtpc_pdu del_req_pdu;
srslte::gtp_fteid_t sgw_ctrl_fteid;
std::map<uint64_t,gtpc_ctx_t>::iterator it = m_imsi_to_gtpc_ctx.find(imsi);
srslte::gtp_fteid_t sgw_ctr_fteid;
srslte::gtp_fteid_t mme_ctr_fteid;
//Get S-GW Ctr TEID
std::map<uint64_t,gtpc_ctx_t>::iterator it_ctx = m_imsi_to_gtpc_ctx.find(imsi);
if(it_ctx == m_imsi_to_gtpc_ctx.end())
{
m_mme_gtpc_log->error("Could not find GTP-C context to remove\n");
return;
}
sgw_ctr_fteid = it_ctx->second.sgw_ctr_fteid;
mme_ctr_fteid = it_ctx->second.mme_ctr_fteid;
srslte::gtpc_header *header = &del_req_pdu.header;
header->teid_present = true;
header->teid = sgw_ctrl_fteid->teid;
header->teid = sgw_ctr_fteid.teid;
header->type = srslte::GTPC_MSG_TYPE_DELETE_SESSION_REQUEST;
srslte::gtpc_delete_session_request *del_req = &del_req_pdu.choice.delete_session_request;
del_req->cause.cause_value = srslte::GTPC_CAUSE_VALUE_ISR_DEACTIVATION;
m_mme_gtpc_log->info("GTP-C Delete Session Request -- S-GW Control TEID %d\n", sgw_ctrl_fteid->teid );
m_mme_gtpc_log->info("GTP-C Delete Session Request -- S-GW Control TEID %d\n", sgw_ctr_fteid.teid );
srslte::gtpc_pdu del_resp_pdu;
m_spgw->handle_delete_session_request(&del_req_pdu, &del_resp_pdu);
//TODO Handle delete session response
//Delete GTP-C context
std::map<uint32_t,uint64_t>::iterator it_imsi = m_mme_ctr_teid_to_imsi.find(mme_ctr_fteid.teid);
if(it_imsi == m_mme_ctr_teid_to_imsi.end())
{
m_mme_gtpc_log->error("Could not find IMSI from MME ctr TEID");
}
else
{
m_mme_ctr_teid_to_imsi.erase(it_imsi);
}
m_imsi_to_gtpc_ctx.erase(it_ctx);
return;
}
void
mme_gtpc::send_release_access_bearers_request(ue_ecm_ctx_t *ecm_ctx)
mme_gtpc::send_release_access_bearers_request(uint64_t imsi)
{
m_mme_gtpc_log->info("Sending GTP-C Delete Access Bearers Request\n");
srslte::gtpc_pdu rel_req_pdu;

@ -283,7 +283,7 @@ s1ap_ctx_mngmt_proc::handle_ue_context_release_request(LIBLTE_S1AP_MESSAGE_UECON
if(active == true)
{
//There are active E-RABs, send delete session request
m_mme_gtpc->send_delete_session_request(ue_ecm_ctx);
m_mme_gtpc->send_delete_session_request(ue_ecm_ctx->imsi);
}
//m_s1ap->delete_ue_ctx(ue_ctx);
for(int i=0;i<MAX_ERABS_PER_UE;i++)

Loading…
Cancel
Save