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
5377b46a
Commit
5377b46a
authored
Jul 28, 2022
by
KARIM BOUTIBA
Browse files
Options
Browse Files
Download
Plain Diff
merge loss of connectivity and communication failure events
parents
82fbb356
0e6acedb
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
217 additions
and
9 deletions
+217
-9
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
-3
src/amf-app/amf_event_sig.hpp
src/amf-app/amf_event_sig.hpp
+8
-0
src/amf-app/amf_n1.cpp
src/amf-app/amf_n1.cpp
+99
-0
src/amf-app/amf_n1.hpp
src/amf-app/amf_n1.hpp
+11
-0
src/amf-app/amf_n11.cpp
src/amf-app/amf_n11.cpp
+2
-0
src/amf-app/amf_n2.cpp
src/amf-app/amf_n2.cpp
+79
-1
src/nas/ies/NSSAI.cpp
src/nas/ies/NSSAI.cpp
+1
-5
No files found.
src/amf-app/amf_event.cpp
View file @
5377b46a
...
...
@@ -56,3 +56,8 @@ 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
);
}
//------------------------------------------------------------------------------
bs2
::
connection
amf_event
::
subscribe_ue_communication_failure
(
const
ue_communication_failure_sig_t
::
slot_type
&
sig
)
{
return
ue_communication_failure
.
connect
(
sig
);
}
src/amf-app/amf_event.hpp
View file @
5377b46a
...
...
@@ -92,14 +92,21 @@ class amf_event {
/*
* Subscribe to UE Loss of Connectivity Notification signal
* @param [const ue_loss_of_connectivity_sig_t::slot_type&] sig: slot_type
* @param [const ue_loss_of_connectivity_sig_t::slot_type&] sig: slot_type*/
bs2
::
connection
subscribe_ue_loss_of_connectivity
(
const
ue_loss_of_connectivity_sig_t
::
slot_type
&
sig
);
/*
* Subscribe to UE Communication Failure Notification signal
* @param [const ue_communication_failure_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
);
bs2
::
connection
subscribe_ue_
communication_failure
(
const
ue_
communication_failure
_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
...
...
@@ -109,5 +116,7 @@ class amf_event {
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
ue_communication_failure_sig_t
ue_communication_failure
;
// Signal for UE Communication Failure Report
};
}
// namespace amf_application
src/amf-app/amf_event_sig.hpp
View file @
5377b46a
...
...
@@ -33,6 +33,7 @@
#include <boost/signals2.hpp>
#include <string>
#include "UserLocation.h"
#include "CommunicationFailure.h"
namespace
bs2
=
boost
::
signals2
;
...
...
@@ -78,6 +79,13 @@ typedef bs2::signal_type<
ue_loss_of_connectivity_sig_t
;
// TODO: Communication-Failure-Report
// Signal for Communication Failure Report
// SUPI, Communication Failure codes, HTTP version
typedef
bs2
::
signal_type
<
void
(
std
::
string
,
oai
::
amf
::
model
::
CommunicationFailure
,
uint8_t
),
bs2
::
keywords
::
mutex_type
<
bs2
::
dummy_mutex
>>::
type
ue_communication_failure_sig_t
;
// TODO: UEs-In-Area-Report
...
...
src/amf-app/amf_n1.cpp
View file @
5377b46a
...
...
@@ -175,6 +175,10 @@ amf_n1::amf_n1() {
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
,
_4
,
_5
));
// EventExposure: subscribe to UE Communication Failure Report
ee_ue_communication_failure_connection
=
event_sub
.
subscribe_ue_communication_failure
(
boost
::
bind
(
&
amf_n1
::
handle_ue_communication_failure_change
,
this
,
_1
,
_2
,
_3
));
}
//------------------------------------------------------------------------------
...
...
@@ -190,6 +194,8 @@ amf_n1::~amf_n1() {
ee_ue_connectivity_state_connection
.
disconnect
();
if
(
ee_ue_loss_of_connectivity_connection
.
connected
())
ee_ue_loss_of_connectivity_connection
.
disconnect
();
if
(
ee_ue_communication_failure_connection
.
connected
())
ee_ue_communication_failure_connection
.
disconnect
();
}
//------------------------------------------------------------------------------
...
...
@@ -1642,6 +1648,21 @@ void amf_n1::send_registration_reject_msg(
bstring
b
=
blk2bstr
(
buffer
,
encoded_size
);
itti_send_dl_nas_buffer_to_task_n2
(
b
,
ran_ue_ngap_id
,
amf_ue_ngap_id
);
// Trigger CommunicationFailure Report notify
oai
::
amf
::
model
::
CommunicationFailure
comm_failure
=
{};
std
::
shared_ptr
<
ue_context
>
uc
=
{};
if
(
!
find_ue_context
(
ran_ue_ngap_id
,
amf_ue_ngap_id
,
uc
))
{
Logger
::
amf_n1
().
warn
(
"Cannot find the UE context, unable to notify CommunicationFailure Report"
);
return
;
}
string
supi
=
uc
.
get
()
->
supi
;
Logger
::
amf_n1
().
debug
(
"Signal the UE CommunicationFailure Report Event notification for SUPI %s"
,
supi
.
c_str
());
comm_failure
.
setNasReleaseCode
(
std
::
to_string
(
cause_value
));
event_sub
.
ue_communication_failure
(
supi
,
comm_failure
,
1
);
}
//------------------------------------------------------------------------------
...
...
@@ -3530,6 +3551,10 @@ void amf_n1::handle_ue_location_change(
itti_msg
->
http_version
=
1
;
for
(
auto
i
:
subscriptions
)
{
// Avoid repeated notifications
// TODO: use the anyUE field from the subscription request
if
(
i
.
get
()
->
supi_is_set
&&
std
::
strcmp
(
i
.
get
()
->
supi
.
c_str
(),
supi
.
c_str
()))
continue
;
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
...
...
@@ -3585,6 +3610,10 @@ void amf_n1::handle_ue_reachability_status_change(
itti_msg
->
http_version
=
1
;
for
(
auto
i
:
subscriptions
)
{
// Avoid repeated notifications
// TODO: use the anyUE field from the subscription request
if
(
i
.
get
()
->
supi_is_set
&&
std
::
strcmp
(
i
.
get
()
->
supi
.
c_str
(),
supi
.
c_str
()))
continue
;
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
...
...
@@ -3645,6 +3674,10 @@ void amf_n1::handle_ue_registration_state_change(
itti_msg
->
http_version
=
1
;
for
(
auto
i
:
subscriptions
)
{
// Avoid repeated notifications
// TODO: use the anyUE field from the subscription request
if
(
i
.
get
()
->
supi_is_set
&&
std
::
strcmp
(
i
.
get
()
->
supi
.
c_str
(),
supi
.
c_str
()))
continue
;
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
...
...
@@ -3716,6 +3749,10 @@ void amf_n1::handle_ue_connectivity_state_change(
itti_msg
->
http_version
=
1
;
for
(
auto
i
:
subscriptions
)
{
// Avoid repeated notifications
// TODO: use the anyUE field from the subscription request
if
(
i
.
get
()
->
supi_is_set
&&
std
::
strcmp
(
i
.
get
()
->
supi
.
c_str
(),
supi
.
c_str
()))
continue
;
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
...
...
@@ -3761,6 +3798,66 @@ void amf_n1::handle_ue_connectivity_state_change(
}
}
//------------------------------------------------------------------------------
void
amf_n1
::
handle_ue_communication_failure_change
(
std
::
string
supi
,
oai
::
amf
::
model
::
CommunicationFailure
comm_failure
,
uint8_t
http_version
)
{
Logger
::
amf_n1
().
debug
(
"Send request to SBI to trigger UE Communication Failure Report (SUPI "
"%s )"
,
supi
.
c_str
());
std
::
vector
<
std
::
shared_ptr
<
amf_subscription
>>
subscriptions
=
{};
amf_app_inst
->
get_ee_subscriptions
(
amf_event_type_t
::
COMMUNICATION_FAILURE_REPORT
,
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
)
{
// Avoid repeated notifications
// TODO: use the anyUE field from the subscription request
if
(
i
.
get
()
->
supi_is_set
&&
std
::
strcmp
(
i
.
get
()
->
supi
.
c_str
(),
supi
.
c_str
()))
continue
;
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
(
"COMMUNICATION_FAILURE_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
.
setCommFailure
(
comm_failure
);
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_loss_of_connectivity_change
(
std
::
string
supi
,
uint8_t
status
,
uint8_t
http_version
,
...
...
@@ -3826,6 +3923,8 @@ void amf_n1::handle_ue_loss_of_connectivity_change(
}
}
//------------------------------------------------------------------------------
void
amf_n1
::
get_pdu_session_to_be_activated
(
const
uint16_t
pdu_session_status
,
...
...
src/amf-app/amf_n1.hpp
View file @
5377b46a
...
...
@@ -826,6 +826,16 @@ class amf_n1 {
void
handle_ue_loss_of_connectivity_change
(
std
::
string
supi
,
uint8_t
status
,
uint8_t
http_version
,
uint32_t
ran_ue_ngap_id
,
long
amf_ue_ngap_id
);
/*
* Handle the UE Communication Failure event to trigger the notification to the
* subscribed NFs
* @param [std::string] supi: SUPI
* @param [oai::amf::model::CommunicationFailure] comm_failure: Communication Failure reason
* @param [uint8_t] http_version: HTTP version (for the notification)
* @return void
*/
void
handle_ue_communication_failure_change
(
std
::
string
supi
,
oai
::
amf
::
model
::
CommunicationFailure
,
uint8_t
http_version
);
// for Event Handling
amf_event
event_sub
;
...
...
@@ -835,6 +845,7 @@ class amf_n1 {
bs2
::
connection
ee_ue_connectivity_state_connection
;
bs2
::
connection
ee_ue_loss_of_connectivity_connection
;
private:
/*
* Handle UE-initiated Deregistration Request message
...
...
src/amf-app/amf_n11.cpp
View file @
5377b46a
...
...
@@ -634,6 +634,8 @@ void amf_n11::handle_itti_message(itti_sbi_notify_subscribed_event& itti_msg) {
}
if
(
r
.
amfUeNgapIdIsSet
())
{
report
[
"amfUeNgapId"
]
=
r
.
getAmfUeNgapId
();
if
(
r
.
commFailureIsSet
())
{
report
[
"commFailure"
]
=
r
.
getCommFailure
();
}
// timestamp
...
...
src/amf-app/amf_n2.cpp
View file @
5377b46a
...
...
@@ -1342,7 +1342,7 @@ void amf_n2::handle_itti_message(itti_ue_context_release_command& itti_msg) {
ueCtxRelCmd
->
setCauseRadioNetwork
(
(
e_Ngap_CauseRadioNetwork
)
itti_msg
.
cause
.
getValue
());
}
uint8_t
buffer
[
BUFFER_SIZE_256
];
int
encoded_size
=
ueCtxRelCmd
->
encode2Buffer
(
buffer
,
BUFFER_SIZE_256
);
...
...
@@ -1350,6 +1350,84 @@ void amf_n2::handle_itti_message(itti_ue_context_release_command& itti_msg) {
sctp_s_38412
.
sctp_send_msg
(
gc
.
get
()
->
sctp_assoc_id
,
unc
.
get
()
->
sctp_stream_send
,
&
b
);
return
;
/*
* Send ITTI to N11 SBI, notify CommunicationFailure Report, RAN Cause
*/
std
::
shared_ptr
<
nas_context
>
nc
=
{};
if
(
amf_n1_inst
->
is_amf_ue_id_2_nas_context
(
itti_msg
.
amf_ue_ngap_id
))
nc
=
amf_n1_inst
->
amf_ue_id_2_nas_context
(
itti_msg
.
amf_ue_ngap_id
);
else
{
Logger
::
amf_n2
().
warn
(
"Could not notify RAN caused CommunicationFailure."
"No existing nas_context with amf_ue_ngap_id("
AMF_UE_NGAP_ID_FMT
")"
,
itti_msg
.
amf_ue_ngap_id
);
return
;
}
string
supi
=
"imsi-"
+
nc
.
get
()
->
imsi
;
Logger
::
amf_n2
().
debug
(
"Send request to SBI to trigger UE Communication Failure Report (SUPI "
"%s )"
,
supi
.
c_str
());
std
::
vector
<
std
::
shared_ptr
<
amf_subscription
>>
subscriptions
=
{};
amf_app_inst
->
get_ee_subscriptions
(
amf_event_type_t
::
COMMUNICATION_FAILURE_REPORT
,
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_ev
=
std
::
make_shared
<
itti_sbi_notify_subscribed_event
>
(
TASK_AMF_N2
,
TASK_AMF_N11
);
itti_msg_ev
->
http_version
=
1
;
for
(
auto
i
:
subscriptions
)
{
// Avoid repeated notifications
// TODO: use the anyUE field from the subscription request
if
(
i
.
get
()
->
supi_is_set
&&
std
::
strcmp
(
i
.
get
()
->
supi
.
c_str
(),
supi
.
c_str
()))
continue
;
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
(
"COMMUNICATION_FAILURE_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
);
oai
::
amf
::
model
::
CommunicationFailure
comm_failure
=
{};
NgApCause
ngap_cause
=
{};
ngap_cause
.
setGroup
(
itti_msg
.
cause
.
getChoiceOfCause
());
ngap_cause
.
setValue
(
itti_msg
.
cause
.
getValue
());
comm_failure
.
setRanReleaseCode
(
ngap_cause
);
event_report
.
setCommFailure
(
comm_failure
);
event_report
.
setSupi
(
supi
);
ev_notif
.
add_report
(
event_report
);
itti_msg_ev
->
event_notifs
.
push_back
(
ev_notif
);
}
int
ret
=
itti_inst
->
send_msg
(
itti_msg_ev
);
if
(
0
!=
ret
)
{
Logger
::
amf_n2
().
error
(
"Could not send ITTI message %s to task TASK_AMF_N11"
,
itti_msg_ev
->
get_msg_name
());
}
}
}
//------------------------------------------------------------------------------
...
...
src/nas/ies/NSSAI.cpp
View file @
5377b46a
...
...
@@ -138,8 +138,6 @@ int NSSAI::decodefrombuffer(uint8_t* buf, int len, bool is_option) {
length
=
*
(
buf
+
decoded_size
);
decoded_size
++
;
int
length_tmp
=
length
;
a
.
sd
=
SD_NO_VALUE
;
// Default value
a
.
mHplmnSd
=
SD_NO_VALUE
;
// Default value
while
(
length_tmp
)
{
switch
(
*
(
buf
+
decoded_size
))
{
...
...
@@ -230,9 +228,7 @@ int NSSAI::decodefrombuffer(uint8_t* buf, int len, bool is_option) {
}
S_NSSAI
.
insert
(
S_NSSAI
.
end
(),
a
);
a
=
{
0
,
0
,
0
,
0
};
a
.
sd
=
SD_NO_VALUE
;
// Default value
a
.
mHplmnSd
=
SD_NO_VALUE
;
// Default value
a
=
{
0
,
0
,
0
,
0
};
}
for
(
int
i
=
0
;
i
<
S_NSSAI
.
size
();
i
++
)
{
...
...
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