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
bb35c2c9
Commit
bb35c2c9
authored
Nov 10, 2022
by
Tien Thinh NGUYEN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix response from AMF to SMF for PDU Session Release notification
parent
bc9e4874
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
31 deletions
+14
-31
src/amf-app/amf_app.cpp
src/amf-app/amf_app.cpp
+6
-4
src/sbi/amf_server/impl/StatusNotifyApiImpl.cpp
src/sbi/amf_server/impl/StatusNotifyApiImpl.cpp
+8
-27
No files found.
src/amf-app/amf_app.cpp
View file @
bb35c2c9
...
...
@@ -746,14 +746,16 @@ void amf_app::handle_itti_message(
if
(
update_pdu_sessions_context
(
itti_msg
.
ue_id
,
itti_msg
.
pdu_session_id
,
itti_msg
.
smContextStatusNotification
))
{
Logger
::
amf_app
().
debug
(
"Update PDU Session Release successfully"
);
response_data
[
"httpResponseCode"
]
=
static_cast
<
uint32_t
>
(
http_response_codes_e
::
HTTP_RESPONSE_CODE_204_NO_CONTENT
);
}
else
{
response_data
[
"httpResponseCode"
]
=
static_cast
<
uint32_t
>
(
http_response_codes_e
::
HTTP_RESPONSE_CODE_BAD_REQUEST
);
oai
::
amf
::
model
::
ProblemDetails
problem_details
=
{};
// TODO set problem_details
to_json
(
response_data
[
"ProblemDetails"
],
problem_details
);
http_response_codes_e
::
HTTP_RESPONSE_CODE_204_NO_CONTENT
);
// TODO check if we set problem_details
Logger
::
amf_app
().
debug
(
"Update PDU Session Release failed"
);
}
// Notify to the result
...
...
src/sbi/amf_server/impl/StatusNotifyApiImpl.cpp
View file @
bb35c2c9
...
...
@@ -36,6 +36,7 @@
#include "logger.hpp"
#include "itti_msg_sbi.hpp"
#include "StatusNotifyApiImpl.h"
#include "conversions.hpp"
extern
itti_mw
*
itti_inst
;
...
...
@@ -58,6 +59,12 @@ void StatusNotifyApiImpl::receive_pdu_session_status_notification(
"Receive PDU Session Release notification, handling..."
);
uint8_t
pdu_session_id
=
0
;
if
(
conv
::
string_to_int8
(
pduSessionId
,
pdu_session_id
))
{
// TODO:
Logger
::
amf_server
().
debug
(
"Invalid PDU Session ID value"
);
response
.
send
(
Pistache
::
Http
::
Code
::
No_Content
);
}
// Generate a promise and associate this promise to the ITTI message
uint32_t
promise_id
=
m_amf_app
->
generate_promise_id
();
Logger
::
amf_n1
().
debug
(
"Promise ID generated %d"
,
promise_id
);
...
...
@@ -97,33 +104,7 @@ void StatusNotifyApiImpl::receive_pdu_session_status_notification(
nlohmann
::
json
result
=
f
.
get
();
Logger
::
amf_server
().
debug
(
"Got result for promise ID %d"
,
promise_id
);
// process data
uint32_t
http_response_code
=
0
;
nlohmann
::
json
json_data
=
{};
if
(
result
.
find
(
"httpResponseCode"
)
!=
result
.
end
())
{
http_response_code
=
result
[
"httpResponseCode"
].
get
<
int
>
();
}
if
(
static_cast
<
http_response_codes_e
>
(
http_response_code
)
==
http_response_codes_e
::
HTTP_RESPONSE_CODE_200_OK
)
{
if
(
result
.
find
(
"content"
)
!=
result
.
end
())
{
json_data
=
result
[
"content"
];
}
response
.
headers
().
add
<
Pistache
::
Http
::
Header
::
ContentType
>
(
Pistache
::
Http
::
Mime
::
MediaType
(
"application/json"
));
response
.
send
(
Pistache
::
Http
::
Code
::
Ok
,
json_data
.
dump
().
c_str
());
}
else
{
// Problem details
if
(
result
.
find
(
"ProblemDetails"
)
!=
result
.
end
())
{
json_data
=
result
[
"ProblemDetails"
];
}
response
.
headers
().
add
<
Pistache
::
Http
::
Header
::
ContentType
>
(
Pistache
::
Http
::
Mime
::
MediaType
(
"application/problem+json"
));
response
.
send
(
Pistache
::
Http
::
Code
(
http_response_code
),
json_data
.
dump
().
c_str
());
}
response
.
send
(
Pistache
::
Http
::
Code
::
No_Content
);
}
}
...
...
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