Commit c240e30e authored by Tien Thinh NGUYEN's avatar Tien Thinh NGUYEN

Bugfix for PDU Session Release Notification

parent 273546b9
......@@ -146,7 +146,8 @@ void IndividualSMContextApiImpl::update_sm_context(
sm_context_req_msg.set_n2_sm_information(n2_sm_information);
sm_context_req_msg.set_n2_sm_info_type(n2_sm_info_type);
} else if (smContextUpdateData.n1SmMsgIsSet()) {
}
if (smContextUpdateData.n1SmMsgIsSet()) {
//N1 SM (for session modification)
std::string n1_sm_message =
smContextUpdateMessage.getBinaryDataN1SmMessage();
......@@ -241,8 +242,7 @@ void IndividualSMContextApiImpl::update_sm_context(
response.headers().add<Pistache::Http::Header::ContentType>(
Pistache::Http::Mime::MediaType(
"multipart/related; boundary=" + std::string(CURL_MIME_BOUNDARY)));
}
if (sm_context_response.n2_sm_info_is_set()) {
} else if (sm_context_response.n2_sm_info_is_set()) {
parser.create_multipart_related_content(
body, json_data.dump(), CURL_MIME_BOUNDARY,
sm_context_response.get_n2_sm_information(),
......
......@@ -118,28 +118,29 @@ void smf_event::send_ee_pdu_session_release(supi64_t supi,
uint8_t http_version) {
Logger::smf_app().debug("Send request to N11 to triger PDU Session Release Notification, SUPI " SUPI_64_FMT " , PDU Session ID %d, HTTP version %d", supi, pdu_session_id, http_version);
std::vector < std::shared_ptr < smf_subscription >> subscriptions;
std::shared_ptr<smf_subscription> subscription;
//std::vector < std::shared_ptr < smf_subscription >> subscriptions;
std::shared_ptr<smf_subscription> subscription = {};
smf_app_inst->get_ee_subscriptions(smf_event_t::SMF_EVENT_PDU_SES_REL, supi,
pdu_session_id, subscription);
//Send request to N11 to trigger the notification to the subscribed event
Logger::smf_app().debug(
if (subscription.get() != nullptr) {
//Send request to N11 to trigger the notification to the subscribed event
Logger::smf_app().debug(
"Send ITTI msg to SMF N11 to trigger the event notification");
std::shared_ptr<itti_n11_notify_subscribed_event> itti_msg = std::make_shared
std::shared_ptr<itti_n11_notify_subscribed_event> itti_msg = std::make_shared
< itti_n11_notify_subscribed_event > (TASK_SMF_APP, TASK_SMF_N11);
event_notification ev_notif = { };
ev_notif.set_pdu_session_id(pdu_session_id);
itti_msg->notif_id = std::to_string(subscription->sub_id);
itti_msg->event_notifs.push_back(ev_notif);
itti_msg->http_version = http_version;
event_notification ev_notif = { };
ev_notif.set_pdu_session_id(pdu_session_id);
itti_msg->notif_id = std::to_string(subscription->sub_id);
itti_msg->event_notifs.push_back(ev_notif);
itti_msg->http_version = http_version;
int ret = itti_inst->send_msg(itti_msg);
if (RETURNok != ret) {
Logger::smf_app().error(
int ret = itti_inst->send_msg(itti_msg);
if (RETURNok != ret) {
Logger::smf_app().error(
"Could not send ITTI message %s to task TASK_SMF_N11",
itti_msg->get_msg_name());
}
}
}
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