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

remove uncessary events

parent 2c3b8e2f
...@@ -2112,103 +2112,105 @@ void smf_app::trigger_upf_status_notification_subscribe() { ...@@ -2112,103 +2112,105 @@ void smf_app::trigger_upf_status_notification_subscribe() {
void smf_app::handle_pdu_session_status_change( void smf_app::handle_pdu_session_status_change(
scid_t scid, const std::string& status, uint8_t http_version) { scid_t scid, const std::string& status, uint8_t http_version) {
Logger::smf_app().debug( /*
"Send request to N11 to triger PDU Session Status Change Notification, " Logger::smf_app().debug(
"SMF Context ID " SCID_FMT " ", "Send request to N11 to triger PDU Session Status Change Notification, "
scid); "SMF Context ID " SCID_FMT " ",
scid);
// get the smf context // get the smf context
std::shared_ptr<smf_context_ref> scf = {}; std::shared_ptr<smf_context_ref> scf = {};
if (is_scid_2_smf_context(scid)) { if (is_scid_2_smf_context(scid)) {
scf = scid_2_smf_context(scid); scf = scid_2_smf_context(scid);
} else { } else {
Logger::smf_app().warn( Logger::smf_app().warn(
"Context associated with this id " SCID_FMT " does not exit!", scid); "Context associated with this id " SCID_FMT " does not exit!", scid);
} }
supi_t supi = scf.get()->supi; supi_t supi = scf.get()->supi;
supi64_t supi64 = smf_supi_to_u64(supi); supi64_t supi64 = smf_supi_to_u64(supi);
pdu_session_id_t pdu_session_id = scf.get()->pdu_session_id; pdu_session_id_t pdu_session_id = scf.get()->pdu_session_id;
std::shared_ptr<smf_context> sc = {}; std::shared_ptr<smf_context> sc = {};
if (is_supi_2_smf_context(supi64)) { if (is_supi_2_smf_context(supi64)) {
sc = supi_2_smf_context(supi64); sc = supi_2_smf_context(supi64);
Logger::smf_app().debug( Logger::smf_app().debug(
"Retrieve SMF context with SUPI " SUPI_64_FMT "", supi64); "Retrieve SMF context with SUPI " SUPI_64_FMT "", supi64);
} else { } else {
Logger::smf_app().warn( Logger::smf_app().warn(
"Could not retrieve the corresponding SMF context with " "Could not retrieve the corresponding SMF context with "
"Supi " SUPI_64_FMT "!", "Supi " SUPI_64_FMT "!",
supi64); supi64);
} }
// get dnn context // get dnn context
std::shared_ptr<dnn_context> sd = {}; std::shared_ptr<dnn_context> sd = {};
if (!sc.get()->find_dnn_context(scf.get()->nssai, scf.get()->dnn, sd)) { if (!sc.get()->find_dnn_context(scf.get()->nssai, scf.get()->dnn, sd)) {
if (nullptr == sd.get()) { if (nullptr == sd.get()) {
Logger::smf_app().warn( Logger::smf_app().warn(
"Could not retrieve the corresponding DNN context!"); "Could not retrieve the corresponding DNN context!");
} }
} }
// get smd_pdu_session // get smd_pdu_session
std::shared_ptr<smf_pdu_session> sp = {}; std::shared_ptr<smf_pdu_session> sp = {};
bool find_pdn = sd.get()->find_pdu_session(pdu_session_id, sp); bool find_pdn = sd.get()->find_pdu_session(pdu_session_id, sp);
if (nullptr == sp.get()) { if (nullptr == sp.get()) {
Logger::smf_app().warn( Logger::smf_app().warn(
"Could not retrieve the corresponding SMF PDU Session context!"); "Could not retrieve the corresponding SMF PDU Session context!");
} }
Logger::smf_app().debug( Logger::smf_app().debug(
"Send request to N11 to triger PDU Session Status Change Notification " "Send request to N11 to triger PDU Session Status Change Notification "
"(Event " "(Event "
"Exposure), SUPI " SUPI_64_FMT " , PDU Session ID %d, HTTP version %d", "Exposure), SUPI " SUPI_64_FMT " , PDU Session ID %d, HTTP version %d",
supi, pdu_session_id, http_version); supi, pdu_session_id, http_version);
std::vector<std::shared_ptr<smf_subscription>> subscriptions = {}; std::vector<std::shared_ptr<smf_subscription>> subscriptions = {};
smf_app_inst->get_ee_subscriptions( smf_app_inst->get_ee_subscriptions(
smf_event_t::SMF_EVENT_PDU_SES_REL, subscriptions); smf_event_t::SMF_EVENT_PDU_SES_REL, subscriptions);
if (subscriptions.size() > 0) { if (subscriptions.size() > 0) {
// Send request to N11 to trigger the notification to the subscribed event // Send request to N11 to trigger the notification to the subscribed event
Logger::smf_app().debug( Logger::smf_app().debug(
"Send ITTI msg to SMF N11 to trigger the event notification"); "Send ITTI msg to SMF N11 to trigger the event notification");
std::shared_ptr<itti_n11_notify_subscribed_event> itti_msg = std::shared_ptr<itti_n11_notify_subscribed_event> itti_msg =
std::make_shared<itti_n11_notify_subscribed_event>( std::make_shared<itti_n11_notify_subscribed_event>(
TASK_SMF_APP, TASK_SMF_SBI); TASK_SMF_APP, TASK_SMF_SBI);
for (auto i : subscriptions) {
event_notification ev_notif = {};
ev_notif.set_supi(supi64);
ev_notif.set_pdu_session_id(pdu_session_id);
ev_notif.set_smf_event(smf_event_t::SMF_EVENT_PDU_SES_REL);
ev_notif.set_notif_uri(i.get()->notif_uri);
ev_notif.set_notif_id(i.get()->notif_id);
// custom json e.g., for FlexCN
nlohmann::json cj = {};
if (sp.get() != nullptr) {
if (sp->ipv4) {
cj["ue_ipv4_addr"] = conv::toString(sp->ipv4_address);
}
cj["pdu_session_type"] = sp->pdu_session_type.toString();
}
ev_notif.set_custom_info(cj); for (auto i : subscriptions) {
itti_msg->event_notifs.push_back(ev_notif); event_notification ev_notif = {};
} ev_notif.set_supi(supi64);
ev_notif.set_pdu_session_id(pdu_session_id);
ev_notif.set_smf_event(smf_event_t::SMF_EVENT_PDU_SES_REL);
ev_notif.set_notif_uri(i.get()->notif_uri);
ev_notif.set_notif_id(i.get()->notif_id);
// custom json e.g., for FlexCN
nlohmann::json cj = {};
if (sp.get() != nullptr) {
if (sp->ipv4) {
cj["ue_ipv4_addr"] = conv::toString(sp->ipv4_address);
}
cj["pdu_session_type"] = sp->pdu_session_type.toString();
}
itti_msg->http_version = http_version; ev_notif.set_custom_info(cj);
itti_msg->event_notifs.push_back(ev_notif);
}
int ret = itti_inst->send_msg(itti_msg); itti_msg->http_version = http_version;
if (RETURNok != ret) {
Logger::smf_app().error( int ret = itti_inst->send_msg(itti_msg);
"Could not send ITTI message %s to task TASK_SMF_SBI", if (RETURNok != ret) {
itti_msg->get_msg_name()); Logger::smf_app().error(
} "Could not send ITTI message %s to task TASK_SMF_SBI",
} else { itti_msg->get_msg_name());
Logger::smf_app().debug("No subscription available for this event"); }
} } else {
Logger::smf_app().debug("No subscription available for this event");
}
*/
} }
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