Commit 9ab6fd90 authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Add PLMN ID as parameter to query UDM

parent 64e521a2
...@@ -701,8 +701,8 @@ void smf_app::handle_pdu_session_create_sm_context_request( ...@@ -701,8 +701,8 @@ void smf_app::handle_pdu_session_create_sm_context_request(
std::string n1_sm_message, n1_sm_message_hex; std::string n1_sm_message, n1_sm_message_hex;
nas_message_t decoded_nas_msg = {}; nas_message_t decoded_nas_msg = {};
cause_value_5gsm_e cause_n1 = {cause_value_5gsm_e::CAUSE_0_UNKNOWN}; cause_value_5gsm_e cause_n1 = {cause_value_5gsm_e::CAUSE_0_UNKNOWN};
pdu_session_type_t pdu_session_type = { pdu_session_type_t pdu_session_type = {.pdu_session_type =
.pdu_session_type = PDU_SESSION_TYPE_E_IPV4}; PDU_SESSION_TYPE_E_IPV4};
// Step 1. Decode NAS and get the necessary information // Step 1. Decode NAS and get the necessary information
int decoder_rc = smf_n1::get_instance().decode_n1_sm_container( int decoder_rc = smf_n1::get_instance().decode_n1_sm_container(
...@@ -954,7 +954,9 @@ void smf_app::handle_pdu_session_create_sm_context_request( ...@@ -954,7 +954,9 @@ void smf_app::handle_pdu_session_create_sm_context_request(
if (not use_local_configuration_subscription_data(dnn_selection_mode)) { if (not use_local_configuration_subscription_data(dnn_selection_mode)) {
Logger::smf_app().debug( Logger::smf_app().debug(
"Retrieve Session Management Subscription data from the UDM"); "Retrieve Session Management Subscription data from the UDM");
if (smf_sbi_inst->get_sm_data(supi64, dnn, snssai, subscription)) { plmn_t plmn = {};
sc.get()->get_plmn(plmn);
if (smf_sbi_inst->get_sm_data(supi64, dnn, snssai, subscription, plmn)) {
// Update dnn_context with subscription info // Update dnn_context with subscription info
sc.get()->insert_dnn_subscription(snssai, dnn, subscription); sc.get()->insert_dnn_subscription(snssai, dnn, subscription);
} else { } else {
......
...@@ -836,11 +836,17 @@ void smf_sbi::subscribe_upf_status_notify( ...@@ -836,11 +836,17 @@ void smf_sbi::subscribe_upf_status_notify(
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool smf_sbi::get_sm_data( bool smf_sbi::get_sm_data(
const supi64_t& supi, const std::string& dnn, const snssai_t& snssai, const supi64_t& supi, const std::string& dnn, const snssai_t& snssai,
std::shared_ptr<session_management_subscription>& subscription) { std::shared_ptr<session_management_subscription>& subscription,
plmn_t plmn) {
nlohmann::json jsonData = {}; nlohmann::json jsonData = {};
std::string query_str = {}; std::string query_str = {};
std::string mcc = {};
std::string mnc = {};
conv::plmnToMccMnc(plmn, mcc, mnc);
query_str = "?single-nssai={\"sst\":" + std::to_string(snssai.sST) + query_str = "?single-nssai={\"sst\":" + std::to_string(snssai.sST) +
",\"sd\":" + snssai.sD + "}&dnn=oai"; ",\"sd\":" + snssai.sD + "}&dnn=oai" +
"&plmn-id={\"mcc\":" + mcc + ",\"mnc\":" + mnc + "}";
std::string url = std::string url =
std::string(inet_ntoa(*((struct in_addr*) &smf_cfg.udm_addr.ipv4_addr))) + std::string(inet_ntoa(*((struct in_addr*) &smf_cfg.udm_addr.ipv4_addr))) +
":" + std::to_string(smf_cfg.udm_addr.port) + NUDM_SDM_BASE + ":" + std::to_string(smf_cfg.udm_addr.port) + NUDM_SDM_BASE +
......
...@@ -157,7 +157,8 @@ class smf_sbi { ...@@ -157,7 +157,8 @@ class smf_sbi {
*/ */
bool get_sm_data( bool get_sm_data(
const supi64_t& supi, const std::string& dnn, const snssai_t& snssai, const supi64_t& supi, const std::string& dnn, const snssai_t& snssai,
std::shared_ptr<session_management_subscription>& subscription); std::shared_ptr<session_management_subscription>& subscription,
plmn_t plmn = {});
/* /*
* Subscribe to be notify from UDM * Subscribe to be notify from UDM
......
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