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