@@ -695,7 +695,7 @@ void mme_app_handle_initial_ue_message(mme_app_desc_t *mme_app_desc_p,
695
695
/*
696
696
* Error during ue context malloc
697
697
*/
698
- DevMessage ( "mme_create_new_ue_context " );
698
+ OAILOG_ERROR ( LOG_MME_APP , "Failed to create new ue context \n " );
699
699
OAILOG_FUNC_OUT (LOG_MME_APP );
700
700
}
701
701
is_mm_ctx_new = true;
@@ -1628,26 +1628,17 @@ void mme_app_handle_e_rab_setup_rsp(
1628
1628
void mme_app_handle_mobile_reachability_timer_expiry (void * args )
1629
1629
{
1630
1630
OAILOG_FUNC_IN (LOG_MME_APP );
1631
- mme_app_desc_t * mme_app_desc_p = NULL ;
1632
1631
mme_ue_s1ap_id_t mme_ue_s1ap_id = * ((mme_ue_s1ap_id_t * ) (args ));
1633
1632
struct ue_mm_context_s * ue_context_p = NULL ;
1634
1633
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" );
1638
1637
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 );
1644
1638
OAILOG_FUNC_OUT (LOG_MME_APP );
1645
1639
}
1646
1640
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
+
1651
1642
// Start Implicit Detach timer
1652
1643
nas_itti_timer_arg_t timer_callback_fun = {0 };
1653
1644
timer_callback_fun .nas_timer_callback =
@@ -1685,28 +1676,16 @@ void mme_app_handle_mobile_reachability_timer_expiry(void* args)
1685
1676
void mme_app_handle_implicit_detach_timer_expiry (void * args )
1686
1677
{
1687
1678
OAILOG_FUNC_IN (LOG_MME_APP );
1688
- mme_app_desc_t * mme_app_desc_p = NULL ;
1689
1679
mme_ue_s1ap_id_t mme_ue_s1ap_id = * ((mme_ue_s1ap_id_t * ) (args ));
1690
1680
struct ue_mm_context_s * ue_context_p = NULL ;
1691
1681
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" );
1695
1685
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 );
1701
1686
OAILOG_FUNC_OUT (LOG_MME_APP );
1702
1687
}
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 );
1708
1688
ue_context_p -> implicit_detach_timer .id = MME_APP_TIMER_INACTIVE_ID ;
1709
-
1710
1689
// Initiate Implicit Detach for the UE
1711
1690
nas_proc_implicit_detach_ue_ind (mme_ue_s1ap_id );
1712
1691
OAILOG_FUNC_OUT (LOG_MME_APP );
@@ -1716,27 +1695,15 @@ void mme_app_handle_implicit_detach_timer_expiry(void* args)
1716
1695
void mme_app_handle_initial_context_setup_rsp_timer_expiry (void * args )
1717
1696
{
1718
1697
OAILOG_FUNC_IN (LOG_MME_APP );
1719
- mme_app_desc_t * mme_app_desc_p = NULL ;
1720
1698
mme_ue_s1ap_id_t mme_ue_s1ap_id = * ((mme_ue_s1ap_id_t * ) (args ));
1721
1699
struct ue_mm_context_s * ue_context_p = NULL ;
1722
1700
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" );
1726
1704
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 );
1732
1705
OAILOG_FUNC_OUT (LOG_MME_APP );
1733
1706
}
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 );
1740
1707
ue_context_p -> initial_context_setup_rsp_timer .id = MME_APP_TIMER_INACTIVE_ID ;
1741
1708
/* *********Abort the ongoing procedure*********
1742
1709
* 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,
2055
2022
void mme_app_handle_paging_timer_expiry (void * args )
2056
2023
{
2057
2024
OAILOG_FUNC_IN (LOG_MME_APP );
2058
- mme_app_desc_t * mme_app_desc_p = NULL ;
2059
2025
mme_ue_s1ap_id_t mme_ue_s1ap_id = * ((mme_ue_s1ap_id_t * ) (args ));
2060
2026
struct ue_mm_context_s * ue_context_p = NULL ;
2027
+ ue_context_p = mme_app_get_ue_context (mme_ue_s1ap_id , "Paging timer" );
2061
2028
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 );
2065
2029
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 );
2071
2030
OAILOG_FUNC_OUT (LOG_MME_APP );
2072
2031
}
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
-
2079
2032
ue_context_p -> paging_response_timer .id = MME_APP_TIMER_INACTIVE_ID ;
2080
2033
if ((mme_app_paging_request_helper (
2081
2034
ue_context_p , false, true /* s-tmsi */ , CN_DOMAIN_PS )) != RETURNok ) {
@@ -2090,26 +2043,15 @@ void mme_app_handle_paging_timer_expiry(void* args)
2090
2043
void mme_app_handle_ulr_timer_expiry (void * args )
2091
2044
{
2092
2045
OAILOG_FUNC_IN (LOG_MME_APP );
2093
- mme_app_desc_t * mme_app_desc_p = NULL ;
2094
2046
mme_ue_s1ap_id_t mme_ue_s1ap_id = * ((mme_ue_s1ap_id_t * ) (args ));
2095
2047
struct ue_mm_context_s * ue_context_p = NULL ;
2096
2048
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" );
2100
2052
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 );
2106
2053
OAILOG_FUNC_OUT (LOG_MME_APP );
2107
2054
}
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 );
2113
2055
ue_context_p -> ulr_response_timer .id = MME_APP_TIMER_INACTIVE_ID ;
2114
2056
2115
2057
// Send PDN CONNECTIVITY FAIL message to NAS layer
@@ -2332,10 +2274,11 @@ int mme_app_handle_nas_extended_service_req(
2332
2274
* not when SERVICE ABORT request is received from MSC/VLR
2333
2275
*/
2334
2276
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
+ */
2335
2280
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
2339
2282
* service_reject in Establish cnf else send in DL NAS Transport
2340
2283
*/
2341
2284
if (ue_context_p -> ecm_state == ECM_IDLE ) {
@@ -2418,26 +2361,15 @@ int mme_app_handle_nas_extended_service_req(
2418
2361
void mme_app_handle_ue_context_modification_timer_expiry (void * args )
2419
2362
{
2420
2363
OAILOG_FUNC_IN (LOG_MME_APP );
2421
- mme_app_desc_t * mme_app_desc_p = NULL ;
2422
2364
mme_ue_s1ap_id_t mme_ue_s1ap_id = * ((mme_ue_s1ap_id_t * ) (args ));
2423
2365
struct ue_mm_context_s * ue_context_p = NULL ;
2424
2366
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" );
2428
2370
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 );
2434
2371
OAILOG_FUNC_OUT (LOG_MME_APP );
2435
2372
}
2436
-
2437
- OAILOG_ERROR (
2438
- LOG_MME_APP ,
2439
- "Expired- UE context modification timer for UE id %d \n" ,
2440
- mme_ue_s1ap_id );
2441
2373
ue_context_p -> ue_context_modification_timer .id = MME_APP_TIMER_INACTIVE_ID ;
2442
2374
2443
2375
if (ue_context_p -> sgs_context != NULL ) {
@@ -3457,3 +3389,31 @@ void mme_app_update_paging_tai_list(
3457
3389
}
3458
3390
OAILOG_FUNC_OUT (LOG_MME_APP );
3459
3391
}
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