Logger::smf_app().debug("Got successful response from AMF (Response code %d), set session status to %s",m.response_code,pdu_session_status_e2str[static_cast<int>(status)].c_str());
//24.501: response with a 5GSM STATUS message including cause "#95 Semantically incorrect message"
smf_n1_n2_inst.create_n1_sm_container(context_req_msg,PDU_SESSION_ESTABLISHMENT_REJECT,n1_container,95);//TODO: should define 5GSM cause in 24.501
binary_data.setContentId(n1_container);
smContextCreateError.setN1SmMsg(binary_data);
smf_n1_n2_inst.create_n1_sm_container(context_req_msg,PDU_SESSION_ESTABLISHMENT_REJECT,n1_sm_message,cause_value_5gsm_e::CAUSE_95_SEMANTICALLY_INCORRECT_MESSAGE);//TODO: should define 5GSM cause in 24.501
//(24.501 (section 7.3.1)) NAS N1 SM message: response with a 5GSM STATUS message including cause "#81 Invalid PTI value"
smf_n1_n2_inst.create_n1_sm_container(context_req_msg,PDU_SESSION_ESTABLISHMENT_REJECT,n1_container,81);//TODO: should define 5GSM cause in 24.501
binary_data.setContentId(n1_container);
smContextCreateError.setN1SmMsg(binary_data);
smf_n1_n2_inst.create_n1_sm_container(context_req_msg,PDU_SESSION_ESTABLISHMENT_REJECT,n1_sm_message,cause_value_5gsm_e::CAUSE_81_INVALID_PTI_VALUE);//TODO: should define 5GSM cause in 24.501
//(24.501 (section 7.4)) implementation dependent->do similar to UE: response with a 5GSM STATUS message including cause "#98 message type not compatible with protocol state."
smf_n1_n2_inst.create_n1_sm_container(context_req_msg,PDU_SESSION_ESTABLISHMENT_REJECT,n1_container,98);//TODO: should define 5GSM cause in 24.501
binary_data.setContentId(n1_container);
smContextCreateError.setN1SmMsg(binary_data);
smf_n1_n2_inst.create_n1_sm_container(context_req_msg,PDU_SESSION_ESTABLISHMENT_REJECT,n1_sm_message,cause_value_5gsm_e::CAUSE_98_MESSAGE_TYPE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE);//TODO: should define 5GSM cause in 24.501
//Contains the URI of the newly created resource, according to the structure: {apiRoot}/nsmf-pdusession/{apiVersion}/sm-contexts/{smContextRef}
//headers: Location: contains the URI of the newly created resource, according to the structure: {apiRoot}/nsmf-pdusession/{apiVersion}/sm-contexts/{smContextRef}
//24.501: response with a 5GSM STATUS message including cause "#95 Semantically incorrect message"
smf_n1_n2_inst.create_n1_sm_container(sm_context_req_msg,PDU_SESSION_ESTABLISHMENT_REJECT,n1_sm_msg,cause_value_5gsm_e::CAUSE_95_SEMANTICALLY_INCORRECT_MESSAGE);//TODO: should define 5GSM cause in 24.501
//Create a N1 SM (PDU Session Modification Command) and N2 SM (PDU Session Resource Setup Request Transfer IE)
std::stringn1_sm_message;
std::stringn2_sm_info;
smf_n1_n2smf_n1_n2_inst;
//N1 SM (PDU Session Modification Command)
smf_n1_n2_inst.create_n1_sm_container(sm_context_req_msg,PDU_SESSION_MODIFICATION_COMMAND,n1_sm_message,cause_value_5gsm_e::CAUSE_0_UNKNOWN);//TODO: need cause?
//N2 SM (PDU Session Resource Modify Request Transfer IE)
Logger::smf_app().info("PDU SESSION CREATE SM CONTEXT REQUEST procedure failed");
remove_procedure(proc);
}
}
//TODO, Step 5.
/* If the PDU Session establishment is not successful, the SMF informs the AMF by invoking Nsmf_PDUSession_SMContextStatusNotify (Release). The SMF also releases any N4
session(s) created, any PDU Session address if allocated (e.g. IP address) and releases the association with PCF,
Logger::smf_n11().debug("Add N1 SM Container (NAS) into the message: %s (bytes %d)",context_res_msg.get_n1_sm_message().c_str(),context_res_msg.get_n1_sm_message().length()/2);
Logger::smf_n11().debug("Add N2 SM Information (NGAP) into the message: %s (bytes %d)",context_res_msg.get_n2_sm_information().c_str(),context_res_msg.get_n2_sm_information().length()/2);
part=curl_mime_addpart(mime);
//curl_mime_data(part, reinterpret_cast<const char*>(n2_msg_hex), context_res_msg.get_n2_sm_information().length()/2); //TODO: ISSUE need to be solved
curl_mime_data(part,reinterpret_cast<constchar*>(n2_msg_hex),80);//TODO: ISSUE need to be solved
smf_n1_n2_inst.create_n1_sm_container(n11_triggered_pending->res,PDU_SESSION_ESTABLISHMENT_REJECT,n1_sm_msg,cause_value_5gsm_e::CAUSE_0_UNKNOWN);//TODO: need cause?
smf_n1_n2_inst.create_n1_sm_container(n11_triggered_pending->res,PDU_SESSION_ESTABLISHMENT_ACCEPT,n1_sm_msg,cause_value_5gsm_e::CAUSE_0_UNKNOWN);//TODO: need cause?
Logger::smf_app().error("Could not send ITTI message %s to task TASK_SMF_N11",n11_triggered_pending->get_msg_name());
}
//The SMF may subscribe to the UE mobility event notification from the AMF (e.g. location reporting, UE
//moving into or out of Area Of Interest), by invoking Namf_EventExposure_Subscribe service operation
// For LADN, the SMF subscribes to the UE moving into or out of LADN service area event notification by providing the LADN DNN as an indicator for the Area Of Interest
/* If the PDU Session establishment is not successful, the SMF informs the AMF by invoking Nsmf_PDUSession_SMContextStatusNotify (Release). The SMF also releases any N4
session(s) created, any PDU Session address if allocated (e.g. IP address) and releases the association with PCF,