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
9ebb6655
Commit
9ebb6655
authored
Apr 12, 2023
by
Tien Thinh NGUYEN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid redundant UE ContextReleaseCommand with consecutive Service Request
parent
a3f0eb72
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
33 deletions
+42
-33
src/amf-app/amf_n1.cpp
src/amf-app/amf_n1.cpp
+31
-26
src/amf-app/amf_n2.cpp
src/amf-app/amf_n2.cpp
+2
-1
src/ngap/ngapIEs/PDUSessionResourceFailedToSetupItemSURes.cpp
...ngap/ngapIEs/PDUSessionResourceFailedToSetupItemSURes.cpp
+9
-6
No files found.
src/amf-app/amf_n1.cpp
View file @
9ebb6655
...
...
@@ -1017,9 +1017,10 @@ void amf_n1::service_request_handle(
std
::
string
guti
=
conv
::
tmsi_to_guti
(
uc
->
tai
.
mcc
,
uc
->
tai
.
mnc
,
amf_cfg
.
guami
.
regionID
,
std
::
to_string
(
amf_set_id
),
std
::
to_string
(
amf_pointer
),
tmsi
);
// nc->guti = std::make_optional<std::string>(guti);
Logger
::
amf_app
().
debug
(
"GUTI %s, 5G-TMSI %s"
,
guti
.
c_str
(),
tmsi
.
c_str
());
// Get Security Context from old NAS Context if neccesary
std
::
shared_ptr
<
nas_context
>
old_nc
=
{};
if
(
guti_2_nas_context
(
guti
,
old_nc
))
{
...
...
@@ -1100,33 +1101,37 @@ void amf_n1::service_request_handle(
"Send UEContextReleaseCommand to release the old NAS connection if "
"necessary"
);
std
::
shared_ptr
<
ue_ngap_context
>
unc
=
{};
string
ue_context_key
=
conv
::
get_ue_context_key
(
// Get UE Context
string
ue_context_key
=
conv
::
get_ue_context_key
(
nc
->
old_ran_ue_ngap_id
,
nc
->
old_amf_ue_ngap_id
);
if
(
!
amf_n2_inst
->
ran_ue_id_2_ue_ngap_context
(
nc
->
old_ran_ue_ngap_id
,
ue_context_key
,
unc
))
{
Logger
::
amf_n1
().
warn
(
"No UE NGAP context with ran_ue_ngap_id ("
GNB_UE_NGAP_ID_FMT
")"
,
nc
->
old_ran_ue_ngap_id
);
std
::
shared_ptr
<
ue_context
>
uc
=
{};
if
(
!
amf_app_inst
->
ran_amf_id_2_ue_context
(
ue_context_key
,
uc
))
{
Logger
::
amf_app
().
error
(
"No UE context for ran_amf_id %s, exit"
,
ue_context_key
.
c_str
()
);
}
else
{
std
::
shared_ptr
<
gnb_context
>
gc
=
{};
if
(
!
amf_n2_inst
->
assoc_id_2_gnb_context
(
unc
->
gnb_assoc_id
,
gc
))
{
Logger
::
amf_n1
().
error
(
"No existed gNB context with assoc_id (%d)"
,
unc
->
gnb_assoc_id
);
}
std
::
shared_ptr
<
itti_ue_context_release_command
>
itti_msg
=
std
::
make_shared
<
itti_ue_context_release_command
>
(
TASK_AMF_N1
,
TASK_AMF_N2
);
itti_msg
->
amf_ue_ngap_id
=
nc
->
old_amf_ue_ngap_id
;
itti_msg
->
ran_ue_ngap_id
=
nc
->
old_ran_ue_ngap_id
;
itti_msg
->
cause
.
setChoiceOfCause
(
Ngap_Cause_PR_radioNetwork
);
itti_msg
->
cause
.
setValue
(
3
);
// TODO: remove hardcoded value cause nas(3)
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_N2"
,
itti_msg
->
get_msg_name
());
std
::
shared_ptr
<
ue_ngap_context
>
unc
=
{};
if
(
!
amf_n2_inst
->
ran_ue_id_2_ue_ngap_context
(
nc
->
old_ran_ue_ngap_id
,
uc
->
gnb_id
,
unc
))
{
Logger
::
amf_n1
().
warn
(
"No UE NGAP context with ran_ue_ngap_id ("
GNB_UE_NGAP_ID_FMT
")"
,
nc
->
old_ran_ue_ngap_id
);
}
else
{
std
::
shared_ptr
<
itti_ue_context_release_command
>
itti_msg
=
std
::
make_shared
<
itti_ue_context_release_command
>
(
TASK_AMF_N1
,
TASK_AMF_N2
);
itti_msg
->
amf_ue_ngap_id
=
nc
->
old_amf_ue_ngap_id
;
itti_msg
->
ran_ue_ngap_id
=
nc
->
old_ran_ue_ngap_id
;
itti_msg
->
cause
.
setChoiceOfCause
(
Ngap_Cause_PR_radioNetwork
);
itti_msg
->
cause
.
setValue
(
3
);
// TODO: remove hardcoded value cause nas(3)
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_N2"
,
itti_msg
->
get_msg_name
());
}
}
}
}
...
...
src/amf-app/amf_n2.cpp
View file @
9ebb6655
...
...
@@ -1366,7 +1366,8 @@ void amf_n2::handle_itti_message(itti_ue_context_release_complete& itti_msg) {
if
(
nc
!=
nullptr
)
{
// Do nothing in case of old NAS Context (Service Request handling)
if
(
nc
->
old_amf_ue_ngap_id
!=
INVALID_AMF_UE_NGAP_ID
)
{
if
((
nc
->
old_amf_ue_ngap_id
!=
INVALID_AMF_UE_NGAP_ID
)
and
(
!
nc
->
guti
.
has_value
()))
{
Logger
::
amf_n2
().
debug
(
"UE Context Release Complete for the old context"
);
return
;
}
...
...
src/ngap/ngapIEs/PDUSessionResourceFailedToSetupItemSURes.cpp
View file @
9ebb6655
...
...
@@ -21,6 +21,8 @@
#include "PDUSessionResourceFailedToSetupItemSURes.hpp"
#include "conversions.hpp"
namespace
ngap
{
//------------------------------------------------------------------------------
...
...
@@ -56,9 +58,10 @@ bool PDUSessionResourceFailedToSetupItemSURes::encode(
if
(
!
pdu_session_id_
.
encode
(
pdu_session_resource_failed_to_setup_item_su_res
->
pDUSessionID
))
return
false
;
pdu_session_resource_failed_to_setup_item_su_res
->
pDUSessionResourceSetupUnsuccessfulTransfer
=
pdu_session_resource_setup_unsuccessful_transfer_
;
conv
::
octet_string_copy
(
pdu_session_resource_failed_to_setup_item_su_res
->
pDUSessionResourceSetupUnsuccessfulTransfer
,
pdu_session_resource_setup_unsuccessful_transfer_
);
return
true
;
}
...
...
@@ -70,10 +73,10 @@ bool PDUSessionResourceFailedToSetupItemSURes::decode(
if
(
!
pdu_session_id_
.
decode
(
pdu_session_resource_failed_to_setup_item_su_res
->
pDUSessionID
))
return
false
;
pdu_session_resource_setup_unsuccessful_transfer_
=
conv
::
octet_string_copy
(
pdu_session_resource_setup_unsuccessful_transfer_
,
pdu_session_resource_failed_to_setup_item_su_res
->
pDUSessionResourceSetupUnsuccessfulTransfer
;
->
pDUSessionResourceSetupUnsuccessfulTransfer
);
return
true
;
}
...
...
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