Commit e5a87729 authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Fix issue for processing NFStatus Notification

parent 2534b061
...@@ -48,7 +48,7 @@ void NFStatusNotifyApiImpl::receive_nf_status_notification( ...@@ -48,7 +48,7 @@ void NFStatusNotifyApiImpl::receive_nf_status_notification(
p = std::make_shared<smf::upf_profile>(); p = std::make_shared<smf::upf_profile>();
nlohmann::json pj = {}; nlohmann::json pj = {};
to_json(pj, notificationData); to_json(pj, notificationData.getNfProfile());
p.get()->from_json(pj); p.get()->from_json(pj);
notification_msg.set_profile(p); notification_msg.set_profile(p);
......
...@@ -1221,7 +1221,7 @@ bool smf_app::handle_nf_status_notification( ...@@ -1221,7 +1221,7 @@ bool smf_app::handle_nf_status_notification(
data_notification_msg notification_msg = msg.get()->notification_msg; data_notification_msg notification_msg = msg.get()->notification_msg;
std::string event_type; std::string event_type;
notification_msg.get_notification_event_type(event_type); notification_msg.get_notification_event_type(event_type);
if (event_type.compare("REGISTERED") == 0) { if (event_type.compare("NF_REGISTERED") == 0) {
std::shared_ptr<nf_profile> profile = {}; std::shared_ptr<nf_profile> profile = {};
notification_msg.get_profile(profile); notification_msg.get_profile(profile);
if (profile.get() != nullptr) { if (profile.get() != nullptr) {
...@@ -1259,6 +1259,9 @@ bool smf_app::handle_nf_status_notification( ...@@ -1259,6 +1259,9 @@ bool smf_app::handle_nf_status_notification(
} else { } else {
return false; return false;
} }
} else {
Logger::smf_app().debug(
"This event (%s) has not been supported yet!", event_type);
} }
return true; return true;
...@@ -1954,10 +1957,10 @@ void smf_app::trigger_upf_status_notification_subscribe() { ...@@ -1954,10 +1957,10 @@ void smf_app::trigger_upf_status_notification_subscribe() {
TASK_SMF_APP, TASK_SMF_N11); TASK_SMF_APP, TASK_SMF_N11);
nlohmann::json json_data = {}; nlohmann::json json_data = {};
//TODO: remove hardcoded values // TODO: remove hardcoded values
json_data["nfStatusNotificationUri"] = json_data["nfStatusNotificationUri"] =
std::string(inet_ntoa(*((struct in_addr*) &smf_cfg.sbi.addr4))) + std::string(inet_ntoa(*((struct in_addr*) &smf_cfg.sbi.addr4))) + ":" +
":" + std::to_string(smf_cfg.sbi.port) + "/nsmf-nfstatus-notify/" + std::to_string(smf_cfg.sbi.port) + "/nsmf-nfstatus-notify/" +
smf_cfg.sbi_api_version + "/subscriptions"; smf_cfg.sbi_api_version + "/subscriptions";
json_data["subscrCond"]["NfTypeCond"]["nfType"] = "UPF"; json_data["subscrCond"]["NfTypeCond"]["nfType"] = "UPF";
......
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