Commit 7b682c40 authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Fix issue when UE attaches again to the network

parent 4e2e3a1e
......@@ -1882,21 +1882,22 @@ bool smf_context::handle_pdu_session_release_complete(
// TODO: return;
}
Logger::smf_app().debug("Signal the SM Context Status Change");
event_sub.sm_context_status(
scid,
static_cast<uint32_t>(sm_context_status_e::SM_CONTEXT_STATUS_RELEASED),
sm_context_request.get()->http_version);
// Get SUPI
supi64_t supi64 = smf_supi_to_u64(sm_context_request.get()->req.get_supi());
// Trigger PDU Session Release event notification
supi64_t supi64 = smf_supi_to_u64(sm_context_request.get()->req.get_supi());
Logger::smf_app().debug("Signal the PDU Session Release Event notification");
event_sub.ee_pdu_session_release(
supi64, sm_context_request.get()->req.get_pdu_session_id(),
sm_context_request.get()->http_version);
// TODO: if dynamic PCC applied, SMF invokes an SM Policy Association
// Termination
// TODO: SMF unsubscribes from Session Management Subscription data
// TODO: SMF un-subscribes from Session Management Subscription data
// changes notification from UDM by invoking Numd_SDM_Unsubscribe
// TODO: should check if sd context exist
......@@ -2990,15 +2991,7 @@ void smf_context::update_qos_info(
QOSFlowDescriptionsContents qos_flow_description_content = {};
// Only one flow description for new requested QoS Flow
// QOSFlowDescriptionsContents* qos_flow_description =
// (QOSFlowDescriptionsContents*) calloc(
// number_of_flow_descriptions, sizeof(QOSFlowDescriptionsContents));
if (number_of_flow_descriptions > 0) {
// qos_flow_description =
// nas_msg.plain.sm.pdu_session_modification_request
// .qosflowdescriptions.qosflowdescriptionscontents;
for (int i = 0; i < number_of_flow_descriptions; i++) {
if (nas_msg.plain.sm.pdu_session_modification_request.qosflowdescriptions
.qosflowdescriptionscontents[i]
......@@ -3127,8 +3120,6 @@ void smf_context::update_qos_info(
// rule identifier
i++;
}
// free_wrapper((void**) &qos_flow_description);
}
//------------------------------------------------------------------------------
......
......@@ -549,16 +549,27 @@ class smf_context : public std::enable_shared_from_this<smf_context> {
scid(0),
event_sub(smf_event::get_instance()) {
supi_prefix = {};
// subscribe to sm context status change
event_sub.subscribe_sm_context_status(boost::bind(
&smf_context::handle_sm_context_status_change, this, _1, _1, _1));
// subscribe to pdu session release (event exposure)
event_sub.subscribe_ee_pdu_session_release(boost::bind(
&smf_context::handle_ee_pdu_session_release, this, _1, _1, _1));
// Subscribe to sm context status change
sm_context_status_connection =
event_sub.subscribe_sm_context_status(boost::bind(
&smf_context::handle_sm_context_status_change, this, _1, _1, _1));
// Subscribe to pdu session release (event exposure)
ee_pdu_session_release_connection =
event_sub.subscribe_ee_pdu_session_release(boost::bind(
&smf_context::handle_ee_pdu_session_release, this, _1, _1, _1));
}
smf_context(smf_context& b) = delete;
virtual ~smf_context() {
Logger::smf_app().debug("Delete SMF Context instance...");
// Disconnect the boost connection
if (sm_context_status_connection.connected())
sm_context_status_connection.disconnect();
if (ee_pdu_session_release_connection.connected())
ee_pdu_session_release_connection.disconnect();
}
/*
* Insert a procedure to be processed
* @param [std::shared_ptr<smf_procedure> &] sproc: procedure to be processed
......@@ -1014,8 +1025,11 @@ class smf_context : public std::enable_shared_from_this<smf_context> {
scid_t scid; // SM Context ID
// Big recursive lock
mutable std::recursive_mutex m_context;
// for Event Handling
smf_event& event_sub;
bs2::connection sm_context_status_connection;
bs2::connection ee_pdu_session_release_connection;
};
} // namespace smf
......
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