Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-AMF
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenXG
OpenXG-AMF
Commits
b4d34c39
Commit
b4d34c39
authored
Jul 18, 2022
by
Arina Prostakova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LOC event subscription, handle and trigger
parent
684aa0cf
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
138 additions
and
1 deletion
+138
-1
src/amf-app/amf_event.cpp
src/amf-app/amf_event.cpp
+5
-0
src/amf-app/amf_event.hpp
src/amf-app/amf_event.hpp
+12
-0
src/amf-app/amf_event_sig.hpp
src/amf-app/amf_event_sig.hpp
+8
-1
src/amf-app/amf_n1.cpp
src/amf-app/amf_n1.cpp
+89
-0
src/amf-app/amf_n1.hpp
src/amf-app/amf_n1.hpp
+12
-0
src/contexts/nas_context.hpp
src/contexts/nas_context.hpp
+12
-0
No files found.
src/amf-app/amf_event.cpp
View file @
b4d34c39
...
...
@@ -51,3 +51,8 @@ bs2::connection amf_event::subscribe_ue_connectivity_state(
const
ue_connectivity_state_sig_t
::
slot_type
&
sig
)
{
return
ue_connectivity_state
.
connect
(
sig
);
}
bs2
::
connection
amf_event
::
subscribe_ue_loss_of_connectivity
(
const
ue_loss_of_connectivity_sig_t
::
slot_type
&
sig
)
{
return
ue_loss_of_connectivity
.
connect
(
sig
);
}
src/amf-app/amf_event.hpp
View file @
b4d34c39
...
...
@@ -90,6 +90,16 @@ class amf_event {
bs2
::
connection
subscribe_ue_connectivity_state
(
const
ue_connectivity_state_sig_t
::
slot_type
&
sig
);
/*
* Subscribe to UE Loss of Connectivity Notification signal
* @param [const ue_loss_of_connectivity_sig_t::slot_type&] sig: slot_type
* parameter
* @return boost::signals2::connection: the connection between the signal and
* the slot
*/
bs2
::
connection
subscribe_ue_loss_of_connectivity
(
const
ue_loss_of_connectivity_sig_t
::
slot_type
&
sig
);
private:
ue_location_report_sig_t
ue_location_report
;
// Signal for UE Location Report
ue_reachability_status_sig_t
...
...
@@ -98,5 +108,7 @@ class amf_event {
ue_registration_state
;
// Signal for UE Registration State Report
ue_connectivity_state_sig_t
ue_connectivity_state
;
// Signal for UE Connectivity State Report
ue_loss_of_connectivity_sig_t
ue_loss_of_connectivity
;
// Signal for UE Loss of Connectivity
};
}
// namespace amf_application
src/amf-app/amf_event_sig.hpp
View file @
b4d34c39
...
...
@@ -69,9 +69,16 @@ typedef bs2::signal_type<
bs2
::
keywords
::
mutex_type
<
bs2
::
dummy_mutex
>>::
type
ue_connectivity_state_sig_t
;
// Signal for Loss of Connectivity
// SUPI, status, HTTP version
typedef
bs2
::
signal_type
<
void
(
std
::
string
,
uint8_t
,
uint8_t
),
bs2
::
keywords
::
mutex_type
<
bs2
::
dummy_mutex
>>::
type
ue_loss_of_connectivity_sig_t
;
// TODO: Communication-Failure-Report
// TODO: UEs-In-Area-Report
// TODO: Loss-of-Connectivity
}
// namespace amf_application
#endif
src/amf-app/amf_n1.cpp
View file @
b4d34c39
...
...
@@ -170,6 +170,11 @@ amf_n1::amf_n1() {
ee_ue_connectivity_state_connection
=
event_sub
.
subscribe_ue_connectivity_state
(
boost
::
bind
(
&
amf_n1
::
handle_ue_connectivity_state_change
,
this
,
_1
,
_2
,
_3
));
// EventExposure: subscribe to UE Loss of Connectivity change
ee_ue_loss_of_connectivity_connection
=
event_sub
.
subscribe_ue_loss_of_connectivity
(
boost
::
bind
(
&
amf_n1
::
handle_ue_loss_of_connectivity_change
,
this
,
_1
,
_2
,
_3
));
}
//------------------------------------------------------------------------------
...
...
@@ -183,6 +188,8 @@ amf_n1::~amf_n1() {
ee_ue_registration_state_connection
.
disconnect
();
if
(
ee_ue_connectivity_state_connection
.
connected
())
ee_ue_connectivity_state_connection
.
disconnect
();
if
(
ee_ue_loss_of_connectivity_connection
.
connected
())
ee_ue_loss_of_connectivity_connection
.
disconnect
();
}
//------------------------------------------------------------------------------
...
...
@@ -3066,11 +3073,24 @@ void amf_n1::ue_initiate_de_registration_handle(
stacs
.
display
();
string
supi
=
"imsi-"
+
nc
.
get
()
->
imsi
;
// Trigger UE Registration Status Notify
Logger
::
amf_n1
().
debug
(
"Signal the UE Registration State Event notification for SUPI %s"
,
supi
.
c_str
());
event_sub
.
ue_registration_state
(
supi
,
_5GMM_DEREGISTERED
,
1
);
// Trigger UE Loss of Connectivity Status Notify
Logger
::
amf_n1
().
debug
(
"Signal the UE Loss of Connectivity Event notification for SUPI %s"
,
supi
.
c_str
());
event_sub
.
ue_loss_of_connectivity
(
supi
,
DEREGISTERED
,
1
);
// Trigger UE Loss of Connectivity Status Notify
Logger
::
amf_n1
().
debug
(
"Signal the UE Loss of Connectivity Event notification for SUPI %s"
,
supi
.
c_str
());
event_sub
.
ue_loss_of_connectivity
(
supi
,
PURGED
,
1
);
if
(
nc
.
get
()
->
is_stacs_available
)
{
stacs
.
update_5gmm_state
(
nc
.
get
()
->
imsi
,
"5GMM-DEREGISTERED"
);
}
...
...
@@ -3718,6 +3738,68 @@ void amf_n1::handle_ue_connectivity_state_change(
}
}
//------------------------------------------------------------------------------
void
amf_n1
::
handle_ue_loss_of_connectivity_change
(
std
::
string
supi
,
uint8_t
status
,
uint8_t
http_version
)
{
Logger
::
amf_n1
().
debug
(
"Send request to SBI to trigger UE Loss of Connectivity (SUPI "
"%s )"
,
supi
.
c_str
());
std
::
vector
<
std
::
shared_ptr
<
amf_subscription
>>
subscriptions
=
{};
amf_app_inst
->
get_ee_subscriptions
(
amf_event_type_t
::
LOSS_OF_CONNECTIVITY
,
subscriptions
);
if
(
subscriptions
.
size
()
>
0
)
{
// Send request to SBI to trigger the notification to the subscribed event
Logger
::
amf_n1
().
debug
(
"Send ITTI msg to AMF SBI to trigger the event notification"
);
std
::
shared_ptr
<
itti_sbi_notify_subscribed_event
>
itti_msg
=
std
::
make_shared
<
itti_sbi_notify_subscribed_event
>
(
TASK_AMF_N1
,
TASK_AMF_N11
);
itti_msg
->
http_version
=
1
;
for
(
auto
i
:
subscriptions
)
{
event_notification
ev_notif
=
{};
ev_notif
.
set_notify_correlation_id
(
i
.
get
()
->
notify_correlation_id
);
ev_notif
.
set_notify_uri
(
i
.
get
()
->
notify_uri
);
// Direct subscription
// ev_notif.set_subs_change_notify_correlation_id(i.get()->notify_uri);
oai
::
amf
::
model
::
AmfEventReport
event_report
=
{};
oai
::
amf
::
model
::
AmfEventType
amf_event_type
=
{};
amf_event_type
.
set_value
(
"LOSS_OF_CONNECTIVITY"
);
event_report
.
setType
(
amf_event_type
);
oai
::
amf
::
model
::
AmfEventState
amf_event_state
=
{};
amf_event_state
.
setActive
(
true
);
event_report
.
setState
(
amf_event_state
);
oai
::
amf
::
model
::
LossOfConnectivityReason
ue_loss_of_connectivity_reason
=
{};
if
(
status
==
DEREGISTERED
)
ue_loss_of_connectivity_reason
.
set_value
(
"DEREGISTERED"
);
else
if
(
status
==
MAX_DETECTION_TIME_EXPIRED
)
ue_loss_of_connectivity_reason
.
set_value
(
"MAX_DETECTION_TIME_EXPIRED"
);
else
if
(
status
==
PURGED
)
ue_loss_of_connectivity_reason
.
set_value
(
"PURGED"
);
event_report
.
setLossOfConnectReason
(
ue_loss_of_connectivity_reason
);
event_report
.
setSupi
(
supi
);
ev_notif
.
add_report
(
event_report
);
itti_msg
->
event_notifs
.
push_back
(
ev_notif
);
}
int
ret
=
itti_inst
->
send_msg
(
itti_msg
);
if
(
0
!=
ret
)
{
Logger
::
amf_n1
().
error
(
"Could not send ITTI message %s to task TASK_AMF_N11"
,
itti_msg
->
get_msg_name
());
}
}
}
//------------------------------------------------------------------------------
void
amf_n1
::
get_pdu_session_to_be_activated
(
const
uint16_t
pdu_session_status
,
...
...
@@ -3897,6 +3979,13 @@ void amf_n1::mobile_reachable_timer_timeout(
}
set_mobile_reachable_timer_timeout
(
nc
,
true
);
// Trigger UE Loss of Connectivity Status Notify
string
supi
=
"imsi-"
+
nc
.
get
()
->
imsi
;
Logger
::
amf_n1
().
debug
(
"Signal the UE Loss of Connectivity Event notification for SUPI %s"
,
supi
.
c_str
());
event_sub
.
ue_loss_of_connectivity
(
supi
,
MAX_DETECTION_TIME_EXPIRED
,
1
);
// TODO: Start the implicit de-registration timer
timer_id_t
tid
=
itti_inst
->
timer_setup
(
IMPLICIT_DEREGISTRATION_TIMER_MIN
*
60
,
0
,
TASK_AMF_N1
,
...
...
src/amf-app/amf_n1.hpp
View file @
b4d34c39
...
...
@@ -813,6 +813,17 @@ class amf_n1 {
void
handle_ue_connectivity_state_change
(
std
::
string
supi
,
uint8_t
status
,
uint8_t
http_version
);
/*
* Handle the UE Loss of Connectivity Change event to trigger the notification
* to the subscribed NFs
* @param [std::string] supi: SUPI
* @param [uint8_t] status: UE Loss of Connectivity status
* @param [uint8_t] http_version: HTTP version (for the notification)
* @return void
*/
void
handle_ue_loss_of_connectivity_change
(
std
::
string
supi
,
uint8_t
status
,
uint8_t
http_version
);
private:
/*
* Handle UE-initiated Deregistration Request message
...
...
@@ -981,6 +992,7 @@ class amf_n1 {
bs2
::
connection
ee_ue_reachability_status_connection
;
bs2
::
connection
ee_ue_registration_state_connection
;
bs2
::
connection
ee_ue_connectivity_state_connection
;
bs2
::
connection
ee_ue_loss_of_connectivity_connection
;
};
}
// namespace amf_application
...
...
src/contexts/nas_context.hpp
View file @
b4d34c39
...
...
@@ -62,6 +62,18 @@ typedef enum { CM_IDLE = 0, CM_CONNECTED } cm_state_t;
static
const
std
::
vector
<
std
::
string
>
cm_state_e2str
=
{
"CM_IDLE"
,
"CM_CONNECTED"
};
typedef
enum
{
DEREGISTERED
=
0
,
MAX_DETECTION_TIME_EXPIRED
,
PURGED
}
loss_of_connectivity_status_t
;
static
const
std
::
vector
<
std
::
string
>
loss_of_connectivity_status_e2str
=
{
"DEREGISTERED"
,
"MAX_DETECTION_TIME_EXPIRED"
,
"PURGED"
};
class
nas_context
{
public:
nas_context
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment