@ -411,24 +411,21 @@ void s1ap::write_pdu(uint16_t rnti, srsran::unique_byte_buffer_t pdu)
bool s1ap : : user_release ( uint16_t rnti , asn1 : : s1ap : : cause_radio_network_e cause_radio )
bool s1ap : : user_release ( uint16_t rnti , asn1 : : s1ap : : cause_radio_network_e cause_radio )
{
{
logger . info ( " User inactivity - RNTI:0x%x " , rnti ) ;
ue * u = users . find_ue_rnti ( rnti ) ;
ue * u = users . find_ue_rnti ( rnti ) ;
if ( u = = nullptr ) {
if ( u = = nullptr ) {
logger . warning ( " Released UE with rnti=0x%x not found " , rnti ) ;
return false ;
return false ;
}
}
if ( u - > was_uectxtrelease_requested ( ) or not u - > ctxt . mme_ue_s1ap_id . has_value ( ) ) {
cause_c cause ;
logger . warning ( " UE context for RNTI:0x%x is in zombie state. Releasing... " , rnti ) ;
cause . set_radio_network ( ) . value = cause_radio . value ;
if ( not u - > send_uectxtreleaserequest ( cause ) ) {
users . erase ( u ) ;
users . erase ( u ) ;
rrc - > release_ue ( rnti ) ;
rrc - > release_ue ( rnti ) ;
return false ;
return false ;
}
}
return true ;
cause_c cause ;
cause . set_radio_network ( ) . value = cause_radio . value ;
return u - > send_uectxtreleaserequest ( cause ) ;
}
}
bool s1ap : : user_exists ( uint16_t rnti )
bool s1ap : : user_exists ( uint16_t rnti )
@ -1402,6 +1399,10 @@ bool s1ap::ue::send_ulnastransport(srsran::unique_byte_buffer_t pdu)
bool s1ap : : ue : : send_uectxtreleaserequest ( const cause_c & cause )
bool s1ap : : ue : : send_uectxtreleaserequest ( const cause_c & cause )
{
{
if ( was_uectxtrelease_requested ( ) ) {
logger . warning ( " UE context for RNTI:0x%x is in zombie state. Releasing... " , ctxt . rnti ) ;
return false ;
}
if ( not ctxt . mme_ue_s1ap_id . has_value ( ) ) {
if ( not ctxt . mme_ue_s1ap_id . has_value ( ) ) {
logger . error ( " Cannot send UE context release request without a MME-UE-S1AP-Id allocated. " ) ;
logger . error ( " Cannot send UE context release request without a MME-UE-S1AP-Id allocated. " ) ;
return false ;
return false ;