@@ -695,7 +695,7 @@ void mme_app_handle_initial_ue_message(mme_app_desc_t *mme_app_desc_p,
695695 /*
696696 * Error during ue context malloc
697697 */
698- DevMessage ( "mme_create_new_ue_context " );
698+ OAILOG_ERROR ( LOG_MME_APP , "Failed to create new ue context \n " );
699699 OAILOG_FUNC_OUT (LOG_MME_APP );
700700 }
701701 is_mm_ctx_new = true;
@@ -1628,26 +1628,17 @@ void mme_app_handle_e_rab_setup_rsp(
16281628void mme_app_handle_mobile_reachability_timer_expiry (void * args )
16291629{
16301630 OAILOG_FUNC_IN (LOG_MME_APP );
1631- mme_app_desc_t * mme_app_desc_p = NULL ;
16321631 mme_ue_s1ap_id_t mme_ue_s1ap_id = * ((mme_ue_s1ap_id_t * ) (args ));
16331632 struct ue_mm_context_s * ue_context_p = NULL ;
16341633
1635- mme_app_desc_p = get_mme_nas_state (false);
1636- ue_context_p = mme_ue_context_exists_mme_ue_s1ap_id (
1637- & mme_app_desc_p -> mme_ue_contexts , mme_ue_s1ap_id );
1634+ ue_context_p = mme_app_get_ue_context (
1635+ mme_ue_s1ap_id ,
1636+ "Mobile reachability timer" );
16381637 if (ue_context_p == NULL ) {
1639- OAILOG_ERROR (
1640- LOG_MME_APP ,
1641- "Mobile Reachability Timer expired, but no assoicated UE context found"
1642- " for ue-id " MME_UE_S1AP_ID_FMT "\n" ,
1643- mme_ue_s1ap_id );
16441638 OAILOG_FUNC_OUT (LOG_MME_APP );
16451639 }
16461640 ue_context_p -> mobile_reachability_timer .id = MME_APP_TIMER_INACTIVE_ID ;
1647- OAILOG_INFO (
1648- LOG_MME_APP ,
1649- "Expired- Mobile Reachability Timer for ue_id:" MME_UE_S1AP_ID_FMT " \n" ,
1650- ue_context_p -> mme_ue_s1ap_id );
1641+
16511642 // Start Implicit Detach timer
16521643 nas_itti_timer_arg_t timer_callback_fun = {0 };
16531644 timer_callback_fun .nas_timer_callback =
@@ -1685,28 +1676,16 @@ void mme_app_handle_mobile_reachability_timer_expiry(void* args)
16851676void mme_app_handle_implicit_detach_timer_expiry (void * args )
16861677{
16871678 OAILOG_FUNC_IN (LOG_MME_APP );
1688- mme_app_desc_t * mme_app_desc_p = NULL ;
16891679 mme_ue_s1ap_id_t mme_ue_s1ap_id = * ((mme_ue_s1ap_id_t * ) (args ));
16901680 struct ue_mm_context_s * ue_context_p = NULL ;
16911681
1692- mme_app_desc_p = get_mme_nas_state (false);
1693- ue_context_p = mme_ue_context_exists_mme_ue_s1ap_id (
1694- & mme_app_desc_p -> mme_ue_contexts , mme_ue_s1ap_id );
1682+ ue_context_p = mme_app_get_ue_context (
1683+ mme_ue_s1ap_id ,
1684+ "Implicit detach timer" );
16951685 if (ue_context_p == NULL ) {
1696- OAILOG_ERROR (
1697- LOG_MME_APP ,
1698- "Implicit Detach Timer expired, but no assoicated UE context for"
1699- "ue-id " MME_UE_S1AP_ID_FMT "\n" ,
1700- mme_ue_s1ap_id );
17011686 OAILOG_FUNC_OUT (LOG_MME_APP );
17021687 }
1703-
1704- OAILOG_INFO (
1705- LOG_MME_APP ,
1706- "Implicit Detach timer expired for UE id" MME_UE_S1AP_ID_FMT "\n" ,
1707- mme_ue_s1ap_id );
17081688 ue_context_p -> implicit_detach_timer .id = MME_APP_TIMER_INACTIVE_ID ;
1709-
17101689 // Initiate Implicit Detach for the UE
17111690 nas_proc_implicit_detach_ue_ind (mme_ue_s1ap_id );
17121691 OAILOG_FUNC_OUT (LOG_MME_APP );
@@ -1716,27 +1695,15 @@ void mme_app_handle_implicit_detach_timer_expiry(void* args)
17161695void mme_app_handle_initial_context_setup_rsp_timer_expiry (void * args )
17171696{
17181697 OAILOG_FUNC_IN (LOG_MME_APP );
1719- mme_app_desc_t * mme_app_desc_p = NULL ;
17201698 mme_ue_s1ap_id_t mme_ue_s1ap_id = * ((mme_ue_s1ap_id_t * ) (args ));
17211699 struct ue_mm_context_s * ue_context_p = NULL ;
17221700
1723- mme_app_desc_p = get_mme_nas_state (false);
1724- ue_context_p = mme_ue_context_exists_mme_ue_s1ap_id (
1725- & mme_app_desc_p -> mme_ue_contexts , mme_ue_s1ap_id );
1701+ ue_context_p = mme_app_get_ue_context (
1702+ mme_ue_s1ap_id ,
1703+ "Initial context setup response timer" );
17261704 if (ue_context_p == NULL ) {
1727- OAILOG_ERROR (
1728- LOG_MME_APP ,
1729- "Initial context setup rsp Timer expired, but no assoicated UE context found"
1730- " for ue_id " MME_UE_S1AP_ID_FMT "\n" ,
1731- mme_ue_s1ap_id );
17321705 OAILOG_FUNC_OUT (LOG_MME_APP );
17331706 }
1734-
1735-
1736- OAILOG_ERROR (
1737- LOG_MME_APP ,
1738- "Expired- Initial context setup rsp timer for UE id %d \n" ,
1739- mme_ue_s1ap_id );
17401707 ue_context_p -> initial_context_setup_rsp_timer .id = MME_APP_TIMER_INACTIVE_ID ;
17411708 /* *********Abort the ongoing procedure*********
17421709 * Check if UE is registered already that implies service request procedure is active. If so then release the S1AP
@@ -2055,27 +2022,13 @@ int mme_app_handle_initial_paging_request(mme_app_desc_t *mme_app_desc_p,
20552022void mme_app_handle_paging_timer_expiry (void * args )
20562023{
20572024 OAILOG_FUNC_IN (LOG_MME_APP );
2058- mme_app_desc_t * mme_app_desc_p = NULL ;
20592025 mme_ue_s1ap_id_t mme_ue_s1ap_id = * ((mme_ue_s1ap_id_t * ) (args ));
20602026 struct ue_mm_context_s * ue_context_p = NULL ;
2027+ ue_context_p = mme_app_get_ue_context (mme_ue_s1ap_id , "Paging timer" );
20612028
2062- mme_app_desc_p = get_mme_nas_state (false);
2063- ue_context_p = mme_ue_context_exists_mme_ue_s1ap_id (
2064- & mme_app_desc_p -> mme_ue_contexts , mme_ue_s1ap_id );
20652029 if (ue_context_p == NULL ) {
2066- OAILOG_ERROR (
2067- LOG_MME_APP ,
2068- "Paging Timer expired, but no assoicated UE context found"
2069- " for ue_id " MME_UE_S1AP_ID_FMT "\n" ,
2070- mme_ue_s1ap_id );
20712030 OAILOG_FUNC_OUT (LOG_MME_APP );
20722031 }
2073-
2074- OAILOG_ERROR (
2075- LOG_MME_APP ,
2076- "Paging Timer expired for ue_id " MME_UE_S1AP_ID_FMT "\n" ,
2077- mme_ue_s1ap_id );
2078-
20792032 ue_context_p -> paging_response_timer .id = MME_APP_TIMER_INACTIVE_ID ;
20802033 if ((mme_app_paging_request_helper (
20812034 ue_context_p , false, true /* s-tmsi */ , CN_DOMAIN_PS )) != RETURNok ) {
@@ -2090,26 +2043,15 @@ void mme_app_handle_paging_timer_expiry(void* args)
20902043void mme_app_handle_ulr_timer_expiry (void * args )
20912044{
20922045 OAILOG_FUNC_IN (LOG_MME_APP );
2093- mme_app_desc_t * mme_app_desc_p = NULL ;
20942046 mme_ue_s1ap_id_t mme_ue_s1ap_id = * ((mme_ue_s1ap_id_t * ) (args ));
20952047 struct ue_mm_context_s * ue_context_p = NULL ;
20962048
2097- mme_app_desc_p = get_mme_nas_state (false);
2098- ue_context_p = mme_ue_context_exists_mme_ue_s1ap_id (
2099- & mme_app_desc_p -> mme_ue_contexts , mme_ue_s1ap_id );
2049+ ue_context_p = mme_app_get_ue_context (
2050+ mme_ue_s1ap_id ,
2051+ "Update location timer" );
21002052 if (ue_context_p == NULL ) {
2101- OAILOG_ERROR (
2102- LOG_MME_APP ,
2103- "Update Location Timer expired, but no assoicated UE context found"
2104- " for ue_id " MME_UE_S1AP_ID_FMT "\n" ,
2105- mme_ue_s1ap_id );
21062053 OAILOG_FUNC_OUT (LOG_MME_APP );
21072054 }
2108-
2109- OAILOG_ERROR (
2110- LOG_MME_APP ,
2111- "Update Location Timer expired for ue-id" MME_UE_S1AP_ID_FMT "\n" ,
2112- mme_ue_s1ap_id );
21132055 ue_context_p -> ulr_response_timer .id = MME_APP_TIMER_INACTIVE_ID ;
21142056
21152057 // Send PDN CONNECTIVITY FAIL message to NAS layer
@@ -2332,10 +2274,11 @@ int mme_app_handle_nas_extended_service_req(
23322274 * not when SERVICE ABORT request is received from MSC/VLR
23332275 */
23342276 ue_context_p -> sgs_context -> mt_call_in_progress = true;
2277+ /* If call_cancelled is set, send Service Reject to UE as MSC/VLR
2278+ * has triggered SGSAP SERVICE ABORT procedure
2279+ */
23352280 if (ue_context_p -> sgs_context -> call_cancelled ) {
2336- /* Sending Service Reject to UE as MSC/VLR has triggered
2337- * SGSAP SERVICE ABORT
2338- * If UE's ECM state is IDLE send
2281+ /* If UE's ECM state is IDLE send
23392282 * service_reject in Establish cnf else send in DL NAS Transport
23402283 */
23412284 if (ue_context_p -> ecm_state == ECM_IDLE ) {
@@ -2418,26 +2361,15 @@ int mme_app_handle_nas_extended_service_req(
24182361void mme_app_handle_ue_context_modification_timer_expiry (void * args )
24192362{
24202363 OAILOG_FUNC_IN (LOG_MME_APP );
2421- mme_app_desc_t * mme_app_desc_p = NULL ;
24222364 mme_ue_s1ap_id_t mme_ue_s1ap_id = * ((mme_ue_s1ap_id_t * ) (args ));
24232365 struct ue_mm_context_s * ue_context_p = NULL ;
24242366
2425- mme_app_desc_p = get_mme_nas_state (false);
2426- ue_context_p = mme_ue_context_exists_mme_ue_s1ap_id (
2427- & mme_app_desc_p -> mme_ue_contexts , mme_ue_s1ap_id );
2367+ ue_context_p = mme_app_get_ue_context (
2368+ mme_ue_s1ap_id ,
2369+ "UE context modification timer" );
24282370 if (ue_context_p == NULL ) {
2429- OAILOG_ERROR (
2430- LOG_MME_APP ,
2431- "UE context modification Timer expired, but no assoicated UE context "
2432- "found for ue-id " MME_UE_S1AP_ID_FMT "\n" ,
2433- mme_ue_s1ap_id );
24342371 OAILOG_FUNC_OUT (LOG_MME_APP );
24352372 }
2436-
2437- OAILOG_ERROR (
2438- LOG_MME_APP ,
2439- "Expired- UE context modification timer for UE id %d \n" ,
2440- mme_ue_s1ap_id );
24412373 ue_context_p -> ue_context_modification_timer .id = MME_APP_TIMER_INACTIVE_ID ;
24422374
24432375 if (ue_context_p -> sgs_context != NULL ) {
@@ -3457,3 +3389,31 @@ void mme_app_update_paging_tai_list(
34573389 }
34583390 OAILOG_FUNC_OUT (LOG_MME_APP );
34593391}
3392+
3393+ // Fetch UE context based on mme_ue_s1ap_id and return pointer to UE context
3394+ ue_mm_context_t * mme_app_get_ue_context (
3395+ mme_ue_s1ap_id_t mme_ue_s1ap_id , char * timer_name )
3396+ {
3397+ OAILOG_FUNC_IN (LOG_MME_APP );
3398+ mme_app_desc_t * mme_app_desc_p = NULL ;
3399+ struct ue_mm_context_s * ue_context_p = NULL ;
3400+
3401+ OAILOG_ERROR (LOG_MME_APP , "Expired- %s for ue_id " MME_UE_S1AP_ID_FMT
3402+ "\n" ,
3403+ timer_name ,
3404+ mme_ue_s1ap_id );
3405+
3406+ mme_app_desc_p = get_mme_nas_state (false);
3407+ ue_context_p = mme_ue_context_exists_mme_ue_s1ap_id (
3408+ & mme_app_desc_p -> mme_ue_contexts , mme_ue_s1ap_id );
3409+ if (ue_context_p == NULL ) {
3410+ OAILOG_ERROR (
3411+ LOG_MME_APP ,
3412+ "Failed to get ue context while handling %s for ue_id "
3413+ MME_UE_S1AP_ID_FMT "\n" ,
3414+ timer_name ,
3415+ mme_ue_s1ap_id );
3416+ return NULL ;
3417+ }
3418+ return ue_context_p ;
3419+ }
0 commit comments