forked from acouzens/open5gs
Merge branch 'MMENetworkDeregTimers' of https://github.com/jmasterfunk84/open5gs into jmasterfunk84-MMENetworkDeregTimers
This commit is contained in:
commit
9e6cff7225
|
@ -437,5 +437,4 @@ usrsctp:
|
||||||
# value: 3240 # 54 minutes * 60 = 3240 seconds
|
# value: 3240 # 54 minutes * 60 = 3240 seconds
|
||||||
# t3423:
|
# t3423:
|
||||||
# value: 720 # 12 minutes * 60 = 720 seconds
|
# value: 720 # 12 minutes * 60 = 720 seconds
|
||||||
#
|
|
||||||
time:
|
time:
|
||||||
|
|
|
@ -61,6 +61,8 @@ void emm_state_de_registered(ogs_fsm_t *s, mme_event_t *e)
|
||||||
|
|
||||||
ogs_assert(e);
|
ogs_assert(e);
|
||||||
|
|
||||||
|
mme_sm_debug(e);
|
||||||
|
|
||||||
mme_ue = e->mme_ue;
|
mme_ue = e->mme_ue;
|
||||||
ogs_assert(mme_ue);
|
ogs_assert(mme_ue);
|
||||||
|
|
||||||
|
@ -110,6 +112,8 @@ void emm_state_registered(ogs_fsm_t *s, mme_event_t *e)
|
||||||
|
|
||||||
ogs_assert(e);
|
ogs_assert(e);
|
||||||
|
|
||||||
|
mme_sm_debug(e);
|
||||||
|
|
||||||
mme_ue = e->mme_ue;
|
mme_ue = e->mme_ue;
|
||||||
ogs_assert(mme_ue);
|
ogs_assert(mme_ue);
|
||||||
|
|
||||||
|
@ -176,6 +180,37 @@ void emm_state_registered(ogs_fsm_t *s, mme_event_t *e)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case MME_TIMER_MOBILE_REACHABLE:
|
||||||
|
ogs_info("[%s] Mobile Reachable timer expired", mme_ue->imsi_bcd);
|
||||||
|
CLEAR_MME_UE_TIMER(mme_ue->t_mobile_reachable);
|
||||||
|
/* TS 24.301 5.3.5
|
||||||
|
* Upon expiry of the mobile reachable timer the network shall
|
||||||
|
* start the implicit detach timer.
|
||||||
|
*/
|
||||||
|
ogs_debug("[%s] Starting Implicit Detach timer",
|
||||||
|
mme_ue->imsi_bcd);
|
||||||
|
ogs_timer_start(mme_ue->t_implicit_detach.timer,
|
||||||
|
ogs_time_from_sec(mme_self()->time.t3412.value + 240));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MME_TIMER_IMPLICIT_DETACH:
|
||||||
|
ogs_info("[%s] Implicit Detach timer expired, detaching UE",
|
||||||
|
mme_ue->imsi_bcd);
|
||||||
|
CLEAR_MME_UE_TIMER(mme_ue->t_implicit_detach);
|
||||||
|
/* TS 24.301 5.3.5
|
||||||
|
* If the implicit detach timer expires before the UE contacts
|
||||||
|
* the network, the network shall implicitly detach the UE.
|
||||||
|
*/
|
||||||
|
mme_ue->detach_type = MME_DETACH_TYPE_MME_IMPLICIT;
|
||||||
|
if (MME_P_TMSI_IS_AVAILABLE(mme_ue)) {
|
||||||
|
ogs_assert(OGS_OK == sgsap_send_detach_indication(mme_ue));
|
||||||
|
} else {
|
||||||
|
mme_send_delete_session_or_detach(mme_ue);
|
||||||
|
}
|
||||||
|
|
||||||
|
OGS_FSM_TRAN(s, &emm_state_de_registered);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
ogs_error("Unknown timer[%s:%d]",
|
ogs_error("Unknown timer[%s:%d]",
|
||||||
mme_timer_get_name(e->timer_id), e->timer_id);
|
mme_timer_get_name(e->timer_id), e->timer_id);
|
||||||
|
@ -198,6 +233,8 @@ static void common_register_state(ogs_fsm_t *s, mme_event_t *e)
|
||||||
|
|
||||||
ogs_assert(e);
|
ogs_assert(e);
|
||||||
|
|
||||||
|
mme_sm_debug(e);
|
||||||
|
|
||||||
mme_ue = e->mme_ue;
|
mme_ue = e->mme_ue;
|
||||||
ogs_assert(mme_ue);
|
ogs_assert(mme_ue);
|
||||||
|
|
||||||
|
@ -640,6 +677,24 @@ static void common_register_state(ogs_fsm_t *s, mme_event_t *e)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!MME_UE_HAVE_IMSI(mme_ue)) {
|
||||||
|
ogs_warn("Detach request : Unknown UE");
|
||||||
|
ogs_assert(OGS_OK ==
|
||||||
|
nas_eps_send_service_reject(mme_ue,
|
||||||
|
OGS_NAS_EMM_CAUSE_UE_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK));
|
||||||
|
OGS_FSM_TRAN(s, &emm_state_exception);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!SECURITY_CONTEXT_IS_VALID(mme_ue)) {
|
||||||
|
ogs_warn("No Security Context : IMSI[%s]", mme_ue->imsi_bcd);
|
||||||
|
ogs_assert(OGS_OK ==
|
||||||
|
nas_eps_send_service_reject(mme_ue,
|
||||||
|
OGS_NAS_EMM_CAUSE_UE_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK));
|
||||||
|
OGS_FSM_TRAN(s, &emm_state_exception);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (MME_P_TMSI_IS_AVAILABLE(mme_ue)) {
|
if (MME_P_TMSI_IS_AVAILABLE(mme_ue)) {
|
||||||
ogs_assert(OGS_OK == sgsap_send_detach_indication(mme_ue));
|
ogs_assert(OGS_OK == sgsap_send_detach_indication(mme_ue));
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -2402,6 +2402,22 @@ mme_ue_t *mme_ue_add(enb_ue_t *enb_ue)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
mme_ue->t3470.pkbuf = NULL;
|
mme_ue->t3470.pkbuf = NULL;
|
||||||
|
mme_ue->t_mobile_reachable.timer = ogs_timer_add(
|
||||||
|
ogs_app()->timer_mgr, mme_timer_mobile_reachable_expire, mme_ue);
|
||||||
|
if (!mme_ue->t_mobile_reachable.timer) {
|
||||||
|
ogs_error("ogs_timer_add() failed");
|
||||||
|
ogs_pool_free(&mme_ue_pool, mme_ue);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
mme_ue->t_mobile_reachable.pkbuf = NULL;
|
||||||
|
mme_ue->t_implicit_detach.timer = ogs_timer_add(
|
||||||
|
ogs_app()->timer_mgr, mme_timer_implicit_detach_expire, mme_ue);
|
||||||
|
if (!mme_ue->t_implicit_detach.timer) {
|
||||||
|
ogs_error("ogs_timer_add() failed");
|
||||||
|
ogs_pool_free(&mme_ue_pool, mme_ue);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
mme_ue->t_implicit_detach.pkbuf = NULL;
|
||||||
|
|
||||||
mme_ebi_pool_init(mme_ue);
|
mme_ebi_pool_init(mme_ue);
|
||||||
|
|
||||||
|
@ -2493,6 +2509,8 @@ void mme_ue_remove(mme_ue_t *mme_ue)
|
||||||
ogs_timer_delete(mme_ue->t3450.timer);
|
ogs_timer_delete(mme_ue->t3450.timer);
|
||||||
ogs_timer_delete(mme_ue->t3460.timer);
|
ogs_timer_delete(mme_ue->t3460.timer);
|
||||||
ogs_timer_delete(mme_ue->t3470.timer);
|
ogs_timer_delete(mme_ue->t3470.timer);
|
||||||
|
ogs_timer_delete(mme_ue->t_mobile_reachable.timer);
|
||||||
|
ogs_timer_delete(mme_ue->t_implicit_detach.timer);
|
||||||
|
|
||||||
enb_ue_unlink(mme_ue);
|
enb_ue_unlink(mme_ue);
|
||||||
|
|
||||||
|
|
|
@ -517,6 +517,8 @@ struct mme_ue_s {
|
||||||
CLEAR_MME_UE_TIMER((__mME)->t3450); \
|
CLEAR_MME_UE_TIMER((__mME)->t3450); \
|
||||||
CLEAR_MME_UE_TIMER((__mME)->t3460); \
|
CLEAR_MME_UE_TIMER((__mME)->t3460); \
|
||||||
CLEAR_MME_UE_TIMER((__mME)->t3470); \
|
CLEAR_MME_UE_TIMER((__mME)->t3470); \
|
||||||
|
CLEAR_MME_UE_TIMER((__mME)->t_mobile_reachable); \
|
||||||
|
CLEAR_MME_UE_TIMER((__mME)->t_implicit_detach); \
|
||||||
\
|
\
|
||||||
ogs_list_for_each(&mme_ue->sess_list, sess) { \
|
ogs_list_for_each(&mme_ue->sess_list, sess) { \
|
||||||
ogs_list_for_each(&sess->bearer_list, bearer) { \
|
ogs_list_for_each(&sess->bearer_list, bearer) { \
|
||||||
|
@ -537,7 +539,8 @@ struct mme_ue_s {
|
||||||
ogs_pkbuf_t *pkbuf;
|
ogs_pkbuf_t *pkbuf;
|
||||||
ogs_timer_t *timer;
|
ogs_timer_t *timer;
|
||||||
uint32_t retry_count;;
|
uint32_t retry_count;;
|
||||||
} t3413, t3422, t3450, t3460, t3470;
|
} t3413, t3422, t3450, t3460, t3470, t_mobile_reachable,
|
||||||
|
t_implicit_detach;
|
||||||
|
|
||||||
#define CLEAR_SERVICE_INDICATOR(__mME) \
|
#define CLEAR_SERVICE_INDICATOR(__mME) \
|
||||||
do { \
|
do { \
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
#include "sgsap-path.h"
|
#include "sgsap-path.h"
|
||||||
#include "mme-gtp-path.h"
|
#include "mme-gtp-path.h"
|
||||||
#include "mme-path.h"
|
#include "mme-path.h"
|
||||||
|
#include "mme-fd-path.h"
|
||||||
#include "mme-sm.h"
|
#include "mme-sm.h"
|
||||||
|
|
||||||
void mme_send_delete_session_or_detach(mme_ue_t *mme_ue)
|
void mme_send_delete_session_or_detach(mme_ue_t *mme_ue)
|
||||||
|
@ -61,10 +62,31 @@ void mme_send_delete_session_or_detach(mme_ue_t *mme_ue)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* MME Implicit Detach, ie: Lost Communication */
|
/* MME Implicit Detach, ie: Lost Communication
|
||||||
|
* TS23.401 - V16.10.0
|
||||||
|
* Ch 5.3.8.3 MME-initiated Detach procedure (Without Step 1)
|
||||||
|
*/
|
||||||
case MME_DETACH_TYPE_MME_IMPLICIT:
|
case MME_DETACH_TYPE_MME_IMPLICIT:
|
||||||
ogs_fatal("Not Implemented : MME_DETACH_TYPE_MME_IMPLICIT");
|
ogs_debug("Implicit MME Detach");
|
||||||
ogs_assert_if_reached();
|
if (SESSION_CONTEXT_IS_AVAILABLE(mme_ue)) {
|
||||||
|
mme_gtp_send_delete_all_sessions(mme_ue,
|
||||||
|
OGS_GTP_DELETE_SEND_RELEASE_WITH_UE_CONTEXT_REMOVE);
|
||||||
|
} else {
|
||||||
|
enb_ue_t *enb_ue = enb_ue_cycle(mme_ue->enb_ue);
|
||||||
|
if (enb_ue) {
|
||||||
|
ogs_assert(OGS_OK ==
|
||||||
|
s1ap_send_ue_context_release_command(enb_ue,
|
||||||
|
S1AP_Cause_PR_nas, S1AP_CauseNas_normal_release,
|
||||||
|
S1AP_UE_CTX_REL_UE_CONTEXT_REMOVE, 0));
|
||||||
|
} else {
|
||||||
|
if (mme_ue->location_updated_but_not_canceled_yet == true) {
|
||||||
|
mme_s6a_send_pur(mme_ue);
|
||||||
|
} else {
|
||||||
|
mme_ue_hash_remove(mme_ue);
|
||||||
|
mme_ue_remove(mme_ue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* HSS Implicit Detach, ie: MME-UPDATE-PROCEDURE
|
/* HSS Implicit Detach, ie: MME-UPDATE-PROCEDURE
|
||||||
|
|
|
@ -904,11 +904,27 @@ void mme_s11_handle_create_bearer_request(
|
||||||
|
|
||||||
if (OGS_FSM_CHECK(&default_bearer->sm, esm_state_active)) {
|
if (OGS_FSM_CHECK(&default_bearer->sm, esm_state_active)) {
|
||||||
if (ECM_IDLE(mme_ue)) {
|
if (ECM_IDLE(mme_ue)) {
|
||||||
|
if (ogs_timer_running(mme_ue->t_implicit_detach.timer)) {
|
||||||
|
/*
|
||||||
|
* TS 24.301 5.3.7
|
||||||
|
* If ISR is not activated, the network behaviour upon expiry of
|
||||||
|
* the mobile reachable timer is network dependent, but typically
|
||||||
|
* the network stops sending paging messages to the UE on the
|
||||||
|
* first expiry, and may take other appropriate actions
|
||||||
|
*/
|
||||||
|
ogs_debug("[%s] Paging stopped: Mobile Reachable timer expiry",
|
||||||
|
mme_ue->imsi_bcd);
|
||||||
|
|
||||||
|
ogs_assert(OGS_OK ==
|
||||||
|
mme_gtp_send_create_bearer_response(
|
||||||
|
bearer, OGS_GTP2_CAUSE_UNABLE_TO_PAGE_UE));
|
||||||
|
} else {
|
||||||
MME_STORE_PAGING_INFO(mme_ue,
|
MME_STORE_PAGING_INFO(mme_ue,
|
||||||
MME_PAGING_TYPE_CREATE_BEARER, bearer);
|
MME_PAGING_TYPE_CREATE_BEARER, bearer);
|
||||||
r = s1ap_send_paging(mme_ue, S1AP_CNDomain_ps);
|
r = s1ap_send_paging(mme_ue, S1AP_CNDomain_ps);
|
||||||
ogs_expect(r == OGS_OK);
|
ogs_expect(r == OGS_OK);
|
||||||
ogs_assert(r != OGS_ERROR);
|
ogs_assert(r != OGS_ERROR);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
r = nas_eps_send_activate_dedicated_bearer_context_request(bearer);
|
r = nas_eps_send_activate_dedicated_bearer_context_request(bearer);
|
||||||
ogs_expect(r == OGS_OK);
|
ogs_expect(r == OGS_OK);
|
||||||
|
@ -1036,11 +1052,27 @@ void mme_s11_handle_update_bearer_request(
|
||||||
if (req->bearer_contexts.bearer_level_qos.presence == 1 ||
|
if (req->bearer_contexts.bearer_level_qos.presence == 1 ||
|
||||||
req->bearer_contexts.tft.presence == 1) {
|
req->bearer_contexts.tft.presence == 1) {
|
||||||
if (ECM_IDLE(mme_ue)) {
|
if (ECM_IDLE(mme_ue)) {
|
||||||
|
if (ogs_timer_running(mme_ue->t_implicit_detach.timer)) {
|
||||||
|
/*
|
||||||
|
* TS 24.301 5.3.7
|
||||||
|
* If ISR is not activated, the network behaviour upon expiry of
|
||||||
|
* the mobile reachable timer is network dependent, but typically
|
||||||
|
* the network stops sending paging messages to the UE on the
|
||||||
|
* first expiry, and may take other appropriate actions
|
||||||
|
*/
|
||||||
|
ogs_debug("[%s] Paging stopped: Mobile Reachable timer expiry",
|
||||||
|
mme_ue->imsi_bcd);
|
||||||
|
|
||||||
|
ogs_assert(OGS_OK ==
|
||||||
|
mme_gtp_send_update_bearer_response(
|
||||||
|
bearer, OGS_GTP2_CAUSE_UNABLE_TO_PAGE_UE));
|
||||||
|
} else {
|
||||||
MME_STORE_PAGING_INFO(mme_ue,
|
MME_STORE_PAGING_INFO(mme_ue,
|
||||||
MME_PAGING_TYPE_UPDATE_BEARER, bearer);
|
MME_PAGING_TYPE_UPDATE_BEARER, bearer);
|
||||||
r = s1ap_send_paging(mme_ue, S1AP_CNDomain_ps);
|
r = s1ap_send_paging(mme_ue, S1AP_CNDomain_ps);
|
||||||
ogs_expect(r == OGS_OK);
|
ogs_expect(r == OGS_OK);
|
||||||
ogs_assert(r != OGS_ERROR);
|
ogs_assert(r != OGS_ERROR);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
r = nas_eps_send_modify_bearer_context_request(bearer,
|
r = nas_eps_send_modify_bearer_context_request(bearer,
|
||||||
req->bearer_contexts.bearer_level_qos.presence,
|
req->bearer_contexts.bearer_level_qos.presence,
|
||||||
|
@ -1175,10 +1207,27 @@ void mme_s11_handle_delete_bearer_request(
|
||||||
bearer->delete.xact = xact;
|
bearer->delete.xact = xact;
|
||||||
|
|
||||||
if (ECM_IDLE(mme_ue)) {
|
if (ECM_IDLE(mme_ue)) {
|
||||||
MME_STORE_PAGING_INFO(mme_ue, MME_PAGING_TYPE_DELETE_BEARER, bearer);
|
if (ogs_timer_running(mme_ue->t_implicit_detach.timer)) {
|
||||||
|
/*
|
||||||
|
* TS 24.301 5.3.7
|
||||||
|
* If ISR is not activated, the network behaviour upon expiry of
|
||||||
|
* the mobile reachable timer is network dependent, but typically
|
||||||
|
* the network stops sending paging messages to the UE on the
|
||||||
|
* first expiry, and may take other appropriate actions
|
||||||
|
*/
|
||||||
|
ogs_debug("[%s] Paging stopped: Mobile Reachable timer expiry",
|
||||||
|
mme_ue->imsi_bcd);
|
||||||
|
|
||||||
|
ogs_assert(OGS_OK ==
|
||||||
|
mme_gtp_send_delete_bearer_response(
|
||||||
|
bearer, OGS_GTP2_CAUSE_UNABLE_TO_PAGE_UE));
|
||||||
|
} else {
|
||||||
|
MME_STORE_PAGING_INFO(mme_ue,
|
||||||
|
MME_PAGING_TYPE_DELETE_BEARER, bearer);
|
||||||
r = s1ap_send_paging(mme_ue, S1AP_CNDomain_ps);
|
r = s1ap_send_paging(mme_ue, S1AP_CNDomain_ps);
|
||||||
ogs_expect(r == OGS_OK);
|
ogs_expect(r == OGS_OK);
|
||||||
ogs_assert(r != OGS_ERROR);
|
ogs_assert(r != OGS_ERROR);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
r = nas_eps_send_deactivate_bearer_context_request(bearer);
|
r = nas_eps_send_deactivate_bearer_context_request(bearer);
|
||||||
ogs_expect(r == OGS_OK);
|
ogs_expect(r == OGS_OK);
|
||||||
|
@ -1435,12 +1484,26 @@ void mme_s11_handle_downlink_data_notification(
|
||||||
* before step 9, the MME shall not send S1 interface paging messages
|
* before step 9, the MME shall not send S1 interface paging messages
|
||||||
*/
|
*/
|
||||||
if (ECM_IDLE(mme_ue)) {
|
if (ECM_IDLE(mme_ue)) {
|
||||||
|
if (ogs_timer_running(mme_ue->t_implicit_detach.timer)) {
|
||||||
|
/*
|
||||||
|
* TS 24.301 5.3.7
|
||||||
|
* If ISR is not activated, the network behaviour upon expiry of
|
||||||
|
* the mobile reachable timer is network dependent, but typically
|
||||||
|
* the network stops sending paging messages to the UE on the
|
||||||
|
* first expiry, and may take other appropriate actions
|
||||||
|
*/
|
||||||
|
ogs_debug("[%s] Paging stopped: Mobile Reachable timer expiry",
|
||||||
|
mme_ue->imsi_bcd);
|
||||||
|
ogs_assert(OGS_OK ==
|
||||||
|
mme_gtp_send_downlink_data_notification_ack(
|
||||||
|
bearer, OGS_GTP2_CAUSE_UNABLE_TO_PAGE_UE));
|
||||||
|
} else {
|
||||||
MME_STORE_PAGING_INFO(mme_ue,
|
MME_STORE_PAGING_INFO(mme_ue,
|
||||||
MME_PAGING_TYPE_DOWNLINK_DATA_NOTIFICATION, bearer);
|
MME_PAGING_TYPE_DOWNLINK_DATA_NOTIFICATION, bearer);
|
||||||
r = s1ap_send_paging(mme_ue, S1AP_CNDomain_ps);
|
r = s1ap_send_paging(mme_ue, S1AP_CNDomain_ps);
|
||||||
ogs_expect(r == OGS_OK);
|
ogs_expect(r == OGS_OK);
|
||||||
ogs_assert(r != OGS_ERROR);
|
ogs_assert(r != OGS_ERROR);
|
||||||
|
}
|
||||||
} else if (ECM_CONNECTED(mme_ue)) {
|
} else if (ECM_CONNECTED(mme_ue)) {
|
||||||
if (cause_value == OGS_GTP2_CAUSE_ERROR_INDICATION_RECEIVED) {
|
if (cause_value == OGS_GTP2_CAUSE_ERROR_INDICATION_RECEIVED) {
|
||||||
|
|
||||||
|
|
|
@ -264,10 +264,28 @@ void mme_s6a_handle_clr(mme_ue_t *mme_ue, ogs_diam_s6a_message_t *s6a_message)
|
||||||
* we need to check whether UE is IDLE or not.
|
* we need to check whether UE is IDLE or not.
|
||||||
*/
|
*/
|
||||||
if (ECM_IDLE(mme_ue)) {
|
if (ECM_IDLE(mme_ue)) {
|
||||||
MME_STORE_PAGING_INFO(mme_ue, MME_PAGING_TYPE_DETACH_TO_UE, NULL);
|
if (ogs_timer_running(mme_ue->t_implicit_detach.timer)) {
|
||||||
|
/*
|
||||||
|
* TS 24.301 5.3.7
|
||||||
|
* If ISR is not activated, the network behaviour upon expiry of
|
||||||
|
* the mobile reachable timer is network dependent, but typically
|
||||||
|
* the network stops sending paging messages to the UE on the
|
||||||
|
* first expiry, and may take other appropriate actions
|
||||||
|
*/
|
||||||
|
ogs_debug("[%s] Paging stopped: Mobile Reachable timer expiry",
|
||||||
|
mme_ue->imsi_bcd);
|
||||||
|
if (MME_P_TMSI_IS_AVAILABLE(mme_ue)) {
|
||||||
|
ogs_assert(OGS_OK == sgsap_send_detach_indication(mme_ue));
|
||||||
|
} else {
|
||||||
|
mme_send_delete_session_or_detach(mme_ue);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
MME_STORE_PAGING_INFO(mme_ue,
|
||||||
|
MME_PAGING_TYPE_DETACH_TO_UE, NULL);
|
||||||
r = s1ap_send_paging(mme_ue, S1AP_CNDomain_ps);
|
r = s1ap_send_paging(mme_ue, S1AP_CNDomain_ps);
|
||||||
ogs_expect(r == OGS_OK);
|
ogs_expect(r == OGS_OK);
|
||||||
ogs_assert(r != OGS_ERROR);
|
ogs_assert(r != OGS_ERROR);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
r = nas_eps_send_detach_request(mme_ue);
|
r = nas_eps_send_detach_request(mme_ue);
|
||||||
ogs_expect(r == OGS_OK);
|
ogs_expect(r == OGS_OK);
|
||||||
|
|
|
@ -307,6 +307,9 @@ void mme_state_operational(ogs_fsm_t *s, mme_event_t *e)
|
||||||
ogs_assert(r != OGS_ERROR);
|
ogs_assert(r != OGS_ERROR);
|
||||||
}
|
}
|
||||||
enb_ue_associate_mme_ue(enb_ue, mme_ue);
|
enb_ue_associate_mme_ue(enb_ue, mme_ue);
|
||||||
|
ogs_debug("Mobile Reachable timer stopped for IMSI[%s]",
|
||||||
|
mme_ue->imsi_bcd);
|
||||||
|
CLEAR_MME_UE_TIMER(mme_ue->t_mobile_reachable);
|
||||||
}
|
}
|
||||||
|
|
||||||
ogs_assert(mme_ue);
|
ogs_assert(mme_ue);
|
||||||
|
|
|
@ -92,6 +92,10 @@ const char *mme_timer_get_name(mme_timer_e id)
|
||||||
return "MME_TIMER_T3470";
|
return "MME_TIMER_T3470";
|
||||||
case MME_TIMER_T3489:
|
case MME_TIMER_T3489:
|
||||||
return "MME_TIMER_T3489";
|
return "MME_TIMER_T3489";
|
||||||
|
case MME_TIMER_MOBILE_REACHABLE:
|
||||||
|
return "MME_TIMER_MOBILE_REACHABLE";
|
||||||
|
case MME_TIMER_IMPLICIT_DETACH:
|
||||||
|
return "MME_TIMER_IMPLICIT_DETACH";
|
||||||
case MME_TIMER_SGS_CLI_CONN_TO_SRV:
|
case MME_TIMER_SGS_CLI_CONN_TO_SRV:
|
||||||
return "MME_TIMER_SGS_CLI_CONN_TO_SRV";
|
return "MME_TIMER_SGS_CLI_CONN_TO_SRV";
|
||||||
case MME_TIMER_S1_HOLDING:
|
case MME_TIMER_S1_HOLDING:
|
||||||
|
@ -160,6 +164,14 @@ void mme_timer_t3470_expire(void *data)
|
||||||
{
|
{
|
||||||
emm_timer_event_send(MME_TIMER_T3470, data);
|
emm_timer_event_send(MME_TIMER_T3470, data);
|
||||||
}
|
}
|
||||||
|
void mme_timer_mobile_reachable_expire(void *data)
|
||||||
|
{
|
||||||
|
emm_timer_event_send(MME_TIMER_MOBILE_REACHABLE, data);
|
||||||
|
}
|
||||||
|
void mme_timer_implicit_detach_expire(void *data)
|
||||||
|
{
|
||||||
|
emm_timer_event_send(MME_TIMER_IMPLICIT_DETACH, data);
|
||||||
|
}
|
||||||
|
|
||||||
static void esm_timer_event_send(
|
static void esm_timer_event_send(
|
||||||
mme_timer_e timer_id, mme_bearer_t *bearer)
|
mme_timer_e timer_id, mme_bearer_t *bearer)
|
||||||
|
|
|
@ -40,6 +40,9 @@ typedef enum {
|
||||||
MME_TIMER_T3470,
|
MME_TIMER_T3470,
|
||||||
MME_TIMER_T3489,
|
MME_TIMER_T3489,
|
||||||
|
|
||||||
|
MME_TIMER_MOBILE_REACHABLE,
|
||||||
|
MME_TIMER_IMPLICIT_DETACH,
|
||||||
|
|
||||||
MME_TIMER_S11_HOLDING,
|
MME_TIMER_S11_HOLDING,
|
||||||
|
|
||||||
MME_TIMER_SGS_CLI_CONN_TO_SRV,
|
MME_TIMER_SGS_CLI_CONN_TO_SRV,
|
||||||
|
@ -67,6 +70,9 @@ void mme_timer_t3460_expire(void *data);
|
||||||
void mme_timer_t3470_expire(void *data);
|
void mme_timer_t3470_expire(void *data);
|
||||||
void mme_timer_t3489_expire(void *data);
|
void mme_timer_t3489_expire(void *data);
|
||||||
|
|
||||||
|
void mme_timer_mobile_reachable_expire(void *data);
|
||||||
|
void mme_timer_implicit_detach_expire(void *data);
|
||||||
|
|
||||||
void mme_timer_sgs_cli_conn_to_srv(void *data);
|
void mme_timer_sgs_cli_conn_to_srv(void *data);
|
||||||
void mme_timer_s1_holding_timer_expire(void *data);
|
void mme_timer_s1_holding_timer_expire(void *data);
|
||||||
void mme_timer_s11_holding_timer_expire(void *data);
|
void mme_timer_s11_holding_timer_expire(void *data);
|
||||||
|
|
|
@ -330,6 +330,9 @@ void s1ap_handle_initial_ue_message(mme_enb_t *enb, ogs_s1ap_message_t *message)
|
||||||
ogs_assert(r != OGS_ERROR);
|
ogs_assert(r != OGS_ERROR);
|
||||||
}
|
}
|
||||||
enb_ue_associate_mme_ue(enb_ue, mme_ue);
|
enb_ue_associate_mme_ue(enb_ue, mme_ue);
|
||||||
|
ogs_debug("Mobile Reachable timer stopped for IMSI[%s]",
|
||||||
|
mme_ue->imsi_bcd);
|
||||||
|
CLEAR_MME_UE_TIMER(mme_ue->t_mobile_reachable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1535,6 +1538,13 @@ void s1ap_handle_ue_context_release_action(enb_ue_t *enb_ue)
|
||||||
* to prevent retransmission of NAS messages.
|
* to prevent retransmission of NAS messages.
|
||||||
*/
|
*/
|
||||||
CLEAR_MME_UE_ALL_TIMERS(mme_ue);
|
CLEAR_MME_UE_ALL_TIMERS(mme_ue);
|
||||||
|
|
||||||
|
if (OGS_FSM_CHECK(&mme_ue->sm, emm_state_registered)) {
|
||||||
|
ogs_debug("Mobile Reachable timer started for IMSI[%s]",
|
||||||
|
mme_ue->imsi_bcd);
|
||||||
|
ogs_timer_start(mme_ue->t_mobile_reachable.timer,
|
||||||
|
ogs_time_from_sec(mme_self()->time.t3412.value + 240));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (enb_ue->ue_ctx_rel_action) {
|
switch (enb_ue->ue_ctx_rel_action) {
|
||||||
|
@ -3099,6 +3109,8 @@ void s1ap_handle_handover_notification(
|
||||||
target_ue->enb_ue_s1ap_id, target_ue->mme_ue_s1ap_id);
|
target_ue->enb_ue_s1ap_id, target_ue->mme_ue_s1ap_id);
|
||||||
|
|
||||||
enb_ue_associate_mme_ue(target_ue, mme_ue);
|
enb_ue_associate_mme_ue(target_ue, mme_ue);
|
||||||
|
ogs_debug("Mobile Reachable timer stopped for IMSI[%s]", mme_ue->imsi_bcd);
|
||||||
|
CLEAR_MME_UE_TIMER(mme_ue->t_mobile_reachable);
|
||||||
|
|
||||||
memcpy(&target_ue->saved.tai.plmn_id, pLMNidentity->buf,
|
memcpy(&target_ue->saved.tai.plmn_id, pLMNidentity->buf,
|
||||||
sizeof(target_ue->saved.tai.plmn_id));
|
sizeof(target_ue->saved.tai.plmn_id));
|
||||||
|
|
|
@ -380,6 +380,8 @@ int s1ap_send_paging(mme_ue_t *mme_ue, S1AP_CNDomain_t cn_domain)
|
||||||
int i;
|
int i;
|
||||||
int rv;
|
int rv;
|
||||||
|
|
||||||
|
ogs_assert(ogs_timer_running(mme_ue->t_implicit_detach.timer) == false);
|
||||||
|
|
||||||
/* Find enB with matched TAI */
|
/* Find enB with matched TAI */
|
||||||
ogs_list_for_each(&mme_self()->enb_list, enb) {
|
ogs_list_for_each(&mme_self()->enb_list, enb) {
|
||||||
for (i = 0; i < enb->num_of_supported_ta_list; i++) {
|
for (i = 0; i < enb->num_of_supported_ta_list; i++) {
|
||||||
|
|
|
@ -387,20 +387,53 @@ void sgsap_handle_paging_request(mme_vlr_t *vlr, ogs_pkbuf_t *pkbuf)
|
||||||
|
|
||||||
if (ECM_IDLE(mme_ue)) {
|
if (ECM_IDLE(mme_ue)) {
|
||||||
if (CS_CALL_SERVICE_INDICATOR(mme_ue)) {
|
if (CS_CALL_SERVICE_INDICATOR(mme_ue)) {
|
||||||
|
if (ogs_timer_running(mme_ue->t_implicit_detach.timer)) {
|
||||||
|
/*
|
||||||
|
* TS 24.301 5.3.7
|
||||||
|
* If ISR is not activated, the network behaviour upon
|
||||||
|
* expiry of the mobile reachable timer is network dependent,
|
||||||
|
* but typically the network stops sending paging messages to
|
||||||
|
* the UE on the first expiry, and may take other appropriate
|
||||||
|
* actions
|
||||||
|
*/
|
||||||
|
ogs_debug("[%s] Paging stopped: Mobile Reachable timeout",
|
||||||
|
mme_ue->imsi_bcd);
|
||||||
|
|
||||||
|
ogs_assert(OGS_OK ==
|
||||||
|
sgsap_send_paging_reject(
|
||||||
|
mme_ue, SGSAP_SGS_CAUSE_UE_UNREACHABLE));
|
||||||
|
} else {
|
||||||
/* UE will respond Extended Service Request in PS CNDomain*/
|
/* UE will respond Extended Service Request in PS CNDomain*/
|
||||||
MME_STORE_PAGING_INFO(mme_ue,
|
MME_STORE_PAGING_INFO(mme_ue,
|
||||||
MME_PAGING_TYPE_CS_CALL_SERVICE, NULL);
|
MME_PAGING_TYPE_CS_CALL_SERVICE, NULL);
|
||||||
r = s1ap_send_paging(mme_ue, S1AP_CNDomain_cs);
|
r = s1ap_send_paging(mme_ue, S1AP_CNDomain_cs);
|
||||||
ogs_expect(r == OGS_OK);
|
ogs_expect(r == OGS_OK);
|
||||||
ogs_assert(r != OGS_ERROR);
|
ogs_assert(r != OGS_ERROR);
|
||||||
|
}
|
||||||
} else if (SMS_SERVICE_INDICATOR(mme_ue)) {
|
} else if (SMS_SERVICE_INDICATOR(mme_ue)) {
|
||||||
|
if (ogs_timer_running(mme_ue->t_implicit_detach.timer)) {
|
||||||
|
/*
|
||||||
|
* TS 24.301 5.3.7
|
||||||
|
* If ISR is not activated, the network behaviour upon
|
||||||
|
* expiry of the mobile reachable timer is network dependent,
|
||||||
|
* but typically the network stops sending paging messages to
|
||||||
|
* the UE on the first expiry, and may take other appropriate
|
||||||
|
* actions
|
||||||
|
*/
|
||||||
|
ogs_debug("[%s] Paging stopped: Mobile Reachable timer expiry",
|
||||||
|
mme_ue->imsi_bcd);
|
||||||
|
|
||||||
|
ogs_assert(OGS_OK ==
|
||||||
|
sgsap_send_paging_reject(
|
||||||
|
mme_ue, SGSAP_SGS_CAUSE_UE_UNREACHABLE));
|
||||||
|
} else {
|
||||||
/* UE will respond Service Request in PS CNDomain*/
|
/* UE will respond Service Request in PS CNDomain*/
|
||||||
MME_STORE_PAGING_INFO(mme_ue,
|
MME_STORE_PAGING_INFO(mme_ue,
|
||||||
MME_PAGING_TYPE_SMS_SERVICE, NULL);
|
MME_PAGING_TYPE_SMS_SERVICE, NULL);
|
||||||
r = s1ap_send_paging(mme_ue, S1AP_CNDomain_ps);
|
r = s1ap_send_paging(mme_ue, S1AP_CNDomain_ps);
|
||||||
ogs_expect(r == OGS_OK);
|
ogs_expect(r == OGS_OK);
|
||||||
ogs_assert(r != OGS_ERROR);
|
ogs_assert(r != OGS_ERROR);
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
goto paging_reject;
|
goto paging_reject;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue