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
3a578f11
Commit
3a578f11
authored
Dec 06, 2021
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
First version for UE Location Report
parent
0254844e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
137 additions
and
4 deletions
+137
-4
src/amf-app/amf_event.cpp
src/amf-app/amf_event.cpp
+6
-0
src/amf-app/amf_event.hpp
src/amf-app/amf_event.hpp
+11
-0
src/amf-app/amf_event_sig.hpp
src/amf-app/amf_event_sig.hpp
+4
-0
src/amf-app/amf_n1.cpp
src/amf-app/amf_n1.cpp
+113
-4
src/amf-app/amf_n1.hpp
src/amf-app/amf_n1.hpp
+3
-0
No files found.
src/amf-app/amf_event.cpp
View file @
3a578f11
...
...
@@ -29,6 +29,12 @@
#include "amf_event.hpp"
using
namespace
amf_application
;
//------------------------------------------------------------------------------
bs2
::
connection
amf_event
::
subscribe_ue_location_report
(
const
ue_location_report_sig_t
::
slot_type
&
sig
)
{
return
ue_location_report
.
connect
(
sig
);
}
//------------------------------------------------------------------------------
bs2
::
connection
amf_event
::
subscribe_ue_reachability_status
(
const
ue_reachability_status_sig_t
::
slot_type
&
sig
)
{
...
...
src/amf-app/amf_event.hpp
View file @
3a578f11
...
...
@@ -50,6 +50,16 @@ class amf_event {
friend
class
amf_n1
;
friend
class
amf_profile
;
/*
* Subscribe to Location Report signal
* @param [const ue_location_report_sig_t::slot_type&] sig: slot_type
* parameter
* @return boost::signals2::connection: the connection between the signal and
* the slot
*/
bs2
::
connection
subscribe_ue_location_report
(
const
ue_location_report_sig_t
::
slot_type
&
sig
);
/*
* Subscribe to UE Reachability Status Notification signal
* @param [const ue_reachability_status_sig_t::slot_type&] sig: slot_type
...
...
@@ -81,6 +91,7 @@ class amf_event {
const
ue_connectivity_state_sig_t
::
slot_type
&
sig
);
private:
ue_location_report_sig_t
ue_location_report
;
// Signal for UE Location Report
ue_reachability_status_sig_t
ue_reachability_status
;
// Signal for UE Reachability Report
ue_registration_state_sig_t
...
...
src/amf-app/amf_event_sig.hpp
View file @
3a578f11
...
...
@@ -32,11 +32,15 @@
#include <boost/signals2.hpp>
#include <string>
#include "UserLocation.h"
namespace
bs2
=
boost
::
signals2
;
namespace
amf_application
{
// TODO: Location-Report
typedef
bs2
::
signal_type
<
void
(
std
::
string
,
oai
::
amf
::
model
::
UserLocation
,
uint8_t
),
bs2
::
keywords
::
mutex_type
<
bs2
::
dummy_mutex
>>::
type
ue_location_report_sig_t
;
// TODO: Presence-In-AOI-Report
// TODO: Time-Zone-Report
// TODO: Access-Type-Report
...
...
src/amf-app/amf_n1.cpp
View file @
3a578f11
...
...
@@ -152,6 +152,10 @@ amf_n1::amf_n1() {
}
Logger
::
amf_n1
().
startup
(
"amf_n1 started"
);
// EventExposure: subscribe to UE Location Report
ee_ue_location_report_connection
=
event_sub
.
subscribe_ue_location_report
(
boost
::
bind
(
&
amf_n1
::
handle_ue_location_change
,
this
,
_1
,
_2
,
_3
));
// EventExposure: subscribe to UE Reachability Status change
ee_ue_reachability_status_connection
=
event_sub
.
subscribe_ue_reachability_status
(
boost
::
bind
(
...
...
@@ -171,6 +175,8 @@ amf_n1::amf_n1() {
//------------------------------------------------------------------------------
amf_n1
::~
amf_n1
()
{
// Disconnect the boost connection
if
(
ee_ue_location_report_connection
.
connected
())
ee_ue_location_report_connection
.
disconnect
();
if
(
ee_ue_reachability_status_connection
.
connected
())
ee_ue_reachability_status_connection
.
disconnect
();
if
(
ee_ue_registration_state_connection
.
connected
())
...
...
@@ -524,7 +530,6 @@ void amf_n1::nas_signalling_establishment_request_handle(
"Signal the UE Reachability Status Event notification for SUPI %s"
,
supi
.
c_str
());
event_sub
.
ue_reachability_status
(
supi
,
CM_CONNECTED
,
1
);
}
else
{
// Logger::amf_n1().debug("existing nas_context with amf_ue_ngap_id(0x%x)
// --> Update",amf_ue_ngap_id); nc =
...
...
@@ -1213,6 +1218,54 @@ void amf_n1::registration_request_handle(
"No Optional NAS Container inside Registration Request message"
);
}
// Trigger UE Location Report
if
(
!
amf_n2_inst
->
is_ran_ue_id_2_ue_ngap_context
(
ran_ue_ngap_id
))
{
Logger
::
amf_n1
().
warn
(
"No UE NGAP context with ran_ue_ngap_id (%d)"
,
ran_ue_ngap_id
);
}
else
{
std
::
shared_ptr
<
ue_ngap_context
>
unc
=
amf_n2_inst
->
ran_ue_id_2_ue_ngap_context
(
ran_ue_ngap_id
);
std
::
shared_ptr
<
gnb_context
>
gc
=
{};
if
(
!
amf_n2_inst
->
is_assoc_id_2_gnb_context
(
unc
.
get
()
->
gnb_assoc_id
))
{
Logger
::
amf_n2
().
error
(
"No existed gNB context with assoc_id (%d)"
,
unc
.
get
()
->
gnb_assoc_id
);
}
else
{
gc
=
amf_n2_inst
->
assoc_id_2_gnb_context
(
unc
.
get
()
->
gnb_assoc_id
);
if
(
gc
.
get
()
&&
uc
.
get
())
{
oai
::
amf
::
model
::
UserLocation
user_location
=
{};
oai
::
amf
::
model
::
NrLocation
nr_location
=
{};
oai
::
amf
::
model
::
Tai
tai
=
{};
nlohmann
::
json
tai_json
=
{};
tai_json
[
"plmnId"
][
"mcc"
]
=
uc
.
get
()
->
cgi
.
mcc
;
tai_json
[
"plmnId"
][
"mnc"
]
=
uc
.
get
()
->
cgi
.
mnc
;
tai_json
[
"tac"
]
=
std
::
to_string
(
uc
.
get
()
->
tai
.
tac
);
from_json
(
tai_json
,
tai
);
// uc.get()->cgi.nrCellID;
nr_location
.
setTai
(
tai
);
nlohmann
::
json
global_ran_node_id_json
=
{};
global_ran_node_id_json
[
"plmnId"
][
"mcc"
]
=
uc
.
get
()
->
cgi
.
mcc
;
global_ran_node_id_json
[
"plmnId"
][
"mnc"
]
=
uc
.
get
()
->
cgi
.
mnc
;
global_ran_node_id_json
[
"gNbId"
][
"bitLength"
]
=
32
;
global_ran_node_id_json
[
"gNbId"
][
"gNBValue"
]
=
gc
->
globalRanNodeId
;
oai
::
amf
::
model
::
GlobalRanNodeId
global_ran_node_id
=
{};
from_json
(
global_ran_node_id_json
,
global_ran_node_id
);
nr_location
.
setGlobalGnbId
(
global_ran_node_id
);
user_location
.
setNrLocation
(
nr_location
);
// Trigger UE Location Report
string
supi
=
uc
.
get
()
->
supi
;
Logger
::
amf_n1
().
debug
(
"Signal the UE Location Report Event notification for SUPI %s"
,
supi
.
c_str
());
event_sub
.
ue_location_report
(
supi
,
user_location
,
1
);
}
}
}
// Store NAS information into nas_context
// Run the corresponding registration procedure
switch
(
reg_type
)
{
...
...
@@ -3097,6 +3150,62 @@ void amf_n1::get_5gcm_state(
state
=
nc
.
get
()
->
nas_status
;
}
//------------------------------------------------------------------------------
void
amf_n1
::
handle_ue_location_change
(
std
::
string
supi
,
oai
::
amf
::
model
::
UserLocation
user_location
,
uint8_t
http_version
)
{
Logger
::
amf_n1
().
debug
(
"Send request to SBI to triger UE Location Report (SUPI "
"%s )"
,
supi
.
c_str
());
std
::
vector
<
std
::
shared_ptr
<
amf_subscription
>>
subscriptions
=
{};
amf_app_inst
->
get_ee_subscriptions
(
amf_event_type_t
::
LOCATION_REPORT
,
subscriptions
);
if
(
subscriptions
.
size
()
>
0
)
{
// Send request to SBI to trigger the notification to the subscribed event
Logger
::
amf_app
().
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
);
// TODO:
// itti_msg->notif_id = "";
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_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
(
"LOCATION_REPORT"
);
event_report
.
setType
(
amf_event_type
);
oai
::
amf
::
model
::
AmfEventState
amf_event_state
=
{};
amf_event_state
.
setActive
(
true
);
event_report
.
setState
(
amf_event_state
);
event_report
.
setLocation
(
user_location
);
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
::
handle_ue_reachability_status_change
(
std
::
string
supi
,
uint8_t
status
,
uint8_t
http_version
)
{
...
...
@@ -3132,7 +3241,7 @@ void amf_n1::handle_ue_reachability_status_change(
amf_event_type
.
set_value
(
"REACHABILITY_REPORT"
);
event_report
.
setType
(
amf_event_type
);
AmfEventState
amf_event_state
=
{};
oai
::
amf
::
model
::
AmfEventState
amf_event_state
=
{};
amf_event_state
.
setActive
(
true
);
event_report
.
setState
(
amf_event_state
);
...
...
@@ -3194,7 +3303,7 @@ void amf_n1::handle_ue_registration_state_change(
amf_event_type
.
set_value
(
"REGISTRATION_STATE_REPORT"
);
event_report
.
setType
(
amf_event_type
);
AmfEventState
amf_event_state
=
{};
oai
::
amf
::
model
::
AmfEventState
amf_event_state
=
{};
amf_event_state
.
setActive
(
true
);
event_report
.
setState
(
amf_event_state
);
...
...
@@ -3262,7 +3371,7 @@ void amf_n1::handle_ue_connectivity_state_change(
amf_event_type
.
set_value
(
"CONNECTIVITY_STATE_REPORT"
);
event_report
.
setType
(
amf_event_type
);
AmfEventState
amf_event_state
=
{};
oai
::
amf
::
model
::
AmfEventState
amf_event_state
=
{};
amf_event_state
.
setActive
(
true
);
event_report
.
setState
(
amf_event_state
);
...
...
src/amf-app/amf_n1.hpp
View file @
3a578f11
...
...
@@ -173,6 +173,8 @@ class amf_n1 {
void
get_5gcm_state
(
const
std
::
shared_ptr
<
nas_context
>&
nc
,
cm_state_t
&
state
)
const
;
void
handle_ue_location_change
(
std
::
string
supi
,
oai
::
amf
::
model
::
UserLocation
,
uint8_t
http_version
);
void
handle_ue_reachability_status_change
(
std
::
string
supi
,
uint8_t
status
,
uint8_t
http_version
);
...
...
@@ -250,6 +252,7 @@ class amf_n1 {
// for Event Handling
amf_event
event_sub
;
bs2
::
connection
ee_ue_location_report_connection
;
bs2
::
connection
ee_ue_reachability_status_connection
;
bs2
::
connection
ee_ue_registration_state_connection
;
bs2
::
connection
ee_ue_connectivity_state_connection
;
...
...
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