mirror of https://github.com/PentHertz/srsLTE.git
Added support to sending error indication when receiving some S1AP messages in the wrong state
This commit is contained in:
parent
4836e90b2c
commit
e68bdf3718
|
@ -712,6 +712,13 @@ bool s1ap::handle_unsuccessfuloutcome(const unsuccessful_outcome_s& msg)
|
|||
|
||||
bool s1ap::handle_s1setupresponse(const asn1::s1ap::s1_setup_resp_s& msg)
|
||||
{
|
||||
if (s1setup_proc.is_idle()) {
|
||||
asn1::s1ap::cause_c cause;
|
||||
cause.set_protocol().value = cause_protocol_opts::msg_not_compatible_with_receiver_state;
|
||||
send_error_indication(cause);
|
||||
return false;
|
||||
}
|
||||
|
||||
s1setupresponse = msg;
|
||||
mme_connected = true;
|
||||
s1_setup_proc_t::s1setupresult res;
|
||||
|
@ -1086,6 +1093,13 @@ bool s1ap::handle_uectxtreleasecommand(const ue_context_release_cmd_s& msg)
|
|||
|
||||
bool s1ap::handle_s1setupfailure(const asn1::s1ap::s1_setup_fail_s& msg)
|
||||
{
|
||||
if (s1setup_proc.is_idle()) {
|
||||
asn1::s1ap::cause_c cause;
|
||||
cause.set_protocol().value = cause_protocol_opts::msg_not_compatible_with_receiver_state;
|
||||
send_error_indication(cause);
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string cause = get_cause(msg.protocol_ies.cause.value);
|
||||
logger.error("S1 Setup Failure. Cause: %s", cause.c_str());
|
||||
srsran::console("S1 Setup Failure. Cause: %s\n", cause.c_str());
|
||||
|
@ -1099,6 +1113,14 @@ bool s1ap::handle_handover_preparation_failure(const ho_prep_fail_s& msg)
|
|||
if (u == nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (u->ho_prep_proc.is_idle()) {
|
||||
asn1::s1ap::cause_c cause;
|
||||
cause.set_protocol().value = cause_protocol_opts::msg_not_compatible_with_receiver_state;
|
||||
send_error_indication(cause);
|
||||
return false;
|
||||
}
|
||||
|
||||
u->ho_prep_proc.trigger(msg);
|
||||
return true;
|
||||
}
|
||||
|
@ -1110,6 +1132,13 @@ bool s1ap::handle_handover_command(const asn1::s1ap::ho_cmd_s& msg)
|
|||
if (u == nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (u->ho_prep_proc.is_idle()) {
|
||||
asn1::s1ap::cause_c cause;
|
||||
cause.set_protocol().value = cause_protocol_opts::msg_not_compatible_with_receiver_state;
|
||||
send_error_indication(cause);
|
||||
return false;
|
||||
}
|
||||
u->ho_prep_proc.trigger(msg);
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue