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
d4884676
Commit
d4884676
authored
Feb 11, 2022
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue to get NRF from NSSF
parent
d6fc2f05
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
37 deletions
+13
-37
src/amf-app/amf_n11.cpp
src/amf-app/amf_n11.cpp
+13
-37
No files found.
src/amf-app/amf_n11.cpp
View file @
d4884676
...
...
@@ -378,28 +378,6 @@ void amf_n11::handle_itti_message(itti_nsmf_pdusession_create_sm_context& smf) {
return
;
}
/*
if (amf_cfg.support_features.enable_nrf_selection) {
if (!discover_smf_from_nsi_info(
smf_addr, smf_api_version, psc.get()->snssai, psc.get()->plmn,
psc.get()->dnn)) {
Logger::amf_n11().error("NRF Selection, no NRF candidate is
available"); return;
}
} else if (amf_cfg.support_features.enable_smf_selection) {
// use NRF to find suitable SMF based on snssai, plmn and dnn
if (!discover_smf(
smf_addr, smf_api_version, psc.get()->snssai, psc.get()->plmn,
psc.get()->dnn)) {
Logger::amf_n11().error("SMF Selection, no SMF candidate is
available"); return;
}
} else if (!smf_selection_from_configuration(smf_addr, smf_api_version))
{ Logger::amf_n11().error( "No SMF candidate is available (from
configuration file)"); return;
}
*/
// store smf info to be used with this PDU session
psc
.
get
()
->
smf_available
=
true
;
psc
->
smf_addr
=
smf_addr
;
...
...
@@ -1606,12 +1584,17 @@ bool amf_n11::get_nrf_uri(
const
snssai_t
&
snssai
,
const
plmn_t
&
plmn
,
const
std
::
string
&
dnn
,
std
::
string
&
nrf_uri
)
{
if
(
!
amf_cfg
.
support_features
.
enable_nrf_selection
)
{
// Get NRF info from configuration file
nrf_uri
=
std
::
string
(
inet_ntoa
(
*
((
struct
in_addr
*
)
&
amf_cfg
.
nrf_addr
.
ipv4_addr
)))
+
":"
+
std
::
to_string
(
amf_cfg
.
nrf_addr
.
port
)
+
"/nnrf-disc/"
+
amf_cfg
.
nrf_addr
.
api_version
+
"/nf-instances"
;
return
true
;
// Get NRF info from configuration file if available
if
(
amf_cfg
.
support_features
.
enable_external_nrf
)
{
nrf_uri
=
std
::
string
(
inet_ntoa
(
*
((
struct
in_addr
*
)
&
amf_cfg
.
nrf_addr
.
ipv4_addr
)))
+
":"
+
std
::
to_string
(
amf_cfg
.
nrf_addr
.
port
)
+
"/nnrf-disc/"
+
amf_cfg
.
nrf_addr
.
api_version
+
"/nf-instances"
;
return
true
;
}
else
{
Logger
::
amf_n11
().
debug
(
"No NRF information from the configuration file"
);
return
false
;
}
}
else
{
// Get NRF info from NSSF
Logger
::
amf_n11
().
debug
(
...
...
@@ -1649,21 +1632,13 @@ bool amf_n11::get_nrf_uri(
curl_http_client
(
nssf_url
,
"GET"
,
""
,
response_data
,
response_code
);
Logger
::
amf_n11
().
debug
(
"N
FDiscovery, response from NR
F, json data:
\n
%s"
,
"N
S Selection, response from NSS
F, json data:
\n
%s"
,
response_data
.
dump
().
c_str
());
std
::
string
nrf_uri
=
{};
if
(
response_code
!=
200
)
{
Logger
::
amf_n11
().
warn
(
"NS Selection, could not get response from NSSF"
);
result
=
false
;
}
else
{
Logger
::
amf_n11
().
debug
(
"NS Selection, got successful response from NSSF"
);
Logger
::
amf_n11
().
debug
(
"NS Selection, response from NSSF, json data:
\n
%s"
,
response_data
.
dump
().
c_str
());
// Process data to obtain NRF info
if
(
response_data
.
find
(
"nsiInformation"
)
!=
response_data
.
end
())
{
if
(
response_data
[
"nsiInformation"
].
count
(
"nrfId"
)
>
0
)
{
...
...
@@ -1683,4 +1658,5 @@ bool amf_n11::get_nrf_uri(
return
result
;
}
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