Commit 61f246d6 authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

fix bug for N2 SM info

parent a91ed1ef
......@@ -13,6 +13,7 @@
#include "IndividualSMContextApiImpl.h"
extern "C" {
#include "Ngap_NGAP-PDU.h"
#include "Ngap_PDUSessionResourceSetupRequestTransfer.h"
}
namespace oai {
namespace smf_server {
......@@ -54,14 +55,18 @@ void IndividualSMContextApiImpl::update_sm_context(const std::string &smContextR
std::string n2_sm_info_type = smContextUpdateData.getN2SmInfoType();
if (n2_sm_info_type.compare("PDU_RES_SETUP_REQ") == 0){
Ngap_PDUSessionResourceSetupRequestTransfer_t *decoded_msg = null;
//Temps: decode Ngap_PDUSessionResourceSetupRequestTransfer
if (n2_sm_info_type.compare(n2_sm_info_type_e2str[PDU_RES_SETUP_REQ]) == 0){
Ngap_PDUSessionResourceSetupRequestTransfer_t *decoded_msg = NULL;
//Decode N2 SM info into decoded nas msg
asn_dec_rval_t rc = asn_decode(NULL,&asn_DEF_Ngap_PDUSessionResourceSetupRequestTransfer, (void **)&decoded_msg, n2_sm_msg_hex, n2_sm_msg_hex.length());
asn_dec_rval_t rc = asn_decode(NULL,ATS_ALIGNED_CANONICAL_PER, &asn_DEF_Ngap_PDUSessionResourceSetupRequestTransfer, (void **)&decoded_msg, (void *)n2_sm_msg_hex.c_str(), n2_sm_msg_hex.length());
if(rc.code != RC_OK)
{
Logger::smf_api_server().warn("asn_decode failed %d...\n",rc.code );
//TODO: send error to AMF??
}
}
/*
......
......@@ -100,6 +100,56 @@ static const std::vector<std::string> pdu_session_application_error_e2str = {
"NETWORK_FAILURE"
};
enum n2_sm_info_type_e {
PDU_RES_SETUP_REQ = 1,
PDU_RES_SETUP_RSP = 2,
PDU_RES_SETUP_FAIL = 3,
PDU_RES_REL_CMD = 4,
PDU_RES_REL_RSP = 5,
PDU_RES_MOD_REQ = 6,
PDU_RES_MOD_RSP = 7,
PDU_RES_MOD_FAIL = 8,
PDU_RES_NTY = 9,
PDU_RES_NTY_REL = 10,
PDU_RES_MOD_IND = 11,
PDU_RES_MOD_CFM = 12,
PATH_SWITCH_REQ = 13,
PATH_SWITCH_SETUP_FAIL = 14,
PATH_SWITCH_REQ_ACK = 15,
PATH_SWITCH_REQ_FAIL = 16,
HANDOVER_REQUIRED = 17,
HANDOVER_CMD = 18,
HANDOVER_PREP_FAIL = 19,
HANDOVER_REQ_ACK = 20,
HANDOVER_RES_ALLOC_FAIL = 21,
SECONDARY_RAT_USAGE = 22
};
static const std::vector<std::string> n2_sm_info_type_e2str = {
"UNKNOWN_TYPE",
"PDU_RES_SETUP_REQ",
"PDU_RES_SETUP_RSP",
"PDU_RES_SETUP_FAIL",
"PDU_RES_REL_CMD",
"PDU_RES_REL_RSP",
"PDU_RES_MOD_REQ",
"PDU_RES_MOD_RSP",
"PDU_RES_MOD_FAIL",
"PDU_RES_NTY",
"PDU_RES_NTY_REL",
"PDU_RES_MOD_IND",
"PDU_RES_MOD_CFM",
"PATH_SWITCH_REQ",
"PATH_SWITCH_SETUP_FAIL",
"PATH_SWITCH_REQ_ACK",
"PATH_SWITCH_REQ_FAIL",
"HANDOVER_REQUIRED",
"HANDOVER_CMD",
"HANDOVER_PREP_FAIL",
"HANDOVER_REQ_ACK",
"HANDOVER_RES_ALLOC_FAIL",
"SECONDARY_RAT_USAGE"
};
#endif
......@@ -495,9 +495,9 @@ void smf_app::handle_amf_msg (std::shared_ptr<itti_n11_update_sm_context_request
supi64_t supi64 = smf_supi_to_u64(supi);
//store in itti_n11_update_sm_context_request to be processed later on
smreq->set_supi(supi);
smreq->set_dnn(dnn);
smreq->set_pdu_session_id(pdu_session_id);
smreq->req.set_supi(supi);
smreq->req.set_dnn(dnn);
smreq->req.set_pdu_session_id(pdu_session_id);
//Step 1. get necessary information (N2 SM information)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment