Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-SMF
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
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-SMF
Commits
9891f5a8
Commit
9891f5a8
authored
Nov 29, 2022
by
Tien Thinh NGUYEN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for PDU Session Create Response message
parent
0061f800
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
12 deletions
+24
-12
src/api-server/impl/SMContextsCollectionApiImpl.cpp
src/api-server/impl/SMContextsCollectionApiImpl.cpp
+9
-10
src/smf_app/smf_app.cpp
src/smf_app/smf_app.cpp
+5
-0
src/smf_app/smf_app.hpp
src/smf_app/smf_app.hpp
+7
-0
src/smf_app/smf_context.cpp
src/smf_app/smf_context.cpp
+3
-2
No files found.
src/api-server/impl/SMContextsCollectionApiImpl.cpp
View file @
9891f5a8
...
...
@@ -118,9 +118,6 @@ void SMContextsCollectionApiImpl::post_sm_contexts(
std
::
string
body
=
{};
bool
n1_sm_msg_is_set
=
false
;
// sm_context_response.get_json_data(json_data);
// sm_context_response.get_json_format(json_format);
int
http_code
=
408
;
// TODO: Request_Timeout
if
(
sm_context_response
.
find
(
"http_code"
)
!=
sm_context_response
.
end
())
{
http_code
=
sm_context_response
[
"http_code"
].
get
<
int
>
();
...
...
@@ -139,6 +136,15 @@ void SMContextsCollectionApiImpl::post_sm_contexts(
n1_sm_msg_is_set
=
true
;
}
if
(
http_code
==
201
)
{
if
(
sm_context_response
.
find
(
"smf_context_uri"
)
!=
sm_context_response
.
end
())
{
response
.
headers
().
add
<
Pistache
::
Http
::
Header
::
Location
>
(
sm_context_response
[
"smf_context_uri"
]
.
get
<
std
::
string
>
());
// Location header
}
}
if
(
n1_sm_msg_is_set
)
{
// add N1 container if available
mime_parser
::
create_multipart_related_content
(
body
,
json_data
.
dump
(),
CURL_MIME_BOUNDARY
,
...
...
@@ -149,13 +155,6 @@ void SMContextsCollectionApiImpl::post_sm_contexts(
"multipart/related; boundary="
+
std
::
string
(
CURL_MIME_BOUNDARY
)));
}
else
if
(
!
json_data
.
empty
())
{
// if not, include json data if available
if
(
sm_context_response
.
find
(
"smf_context_uri"
)
!=
sm_context_response
.
end
())
{
response
.
headers
().
add
<
Pistache
::
Http
::
Header
::
Location
>
(
sm_context_response
[
"smf_context_uri"
]
.
get
<
std
::
string
>
());
// Location header
}
response
.
headers
().
add
<
Pistache
::
Http
::
Header
::
ContentType
>
(
Pistache
::
Http
::
Mime
::
MediaType
(
json_format
));
body
=
json_data
.
dump
().
c_str
();
...
...
src/smf_app/smf_app.cpp
View file @
9891f5a8
...
...
@@ -2371,3 +2371,8 @@ void smf_app::trigger_upf_status_notification_subscribe() {
itti_msg
->
get_msg_name
());
}
}
//------------------------------------------------------------------------------
std
::
string
smf_app
::
get_smf_instance_id
()
const
{
return
smf_instance_id
;
}
src/smf_app/smf_app.hpp
View file @
9891f5a8
...
...
@@ -904,6 +904,13 @@ class smf_app {
* @return void
*/
void
trigger_upf_status_notification_subscribe
();
/*
* Get the SMF instance ID
* @param [void]
* @return SMF instance ID
*/
std
::
string
get_smf_instance_id
()
const
;
};
}
// namespace smf
#include "smf_config.hpp"
...
...
src/smf_app/smf_context.cpp
View file @
9891f5a8
...
...
@@ -1755,8 +1755,9 @@ void smf_context::handle_pdu_session_create_sm_context_request(
cause_value_5gsm_e
::
CAUSE_255_REQUEST_ACCEPTED
));
// TODO
nlohmann
::
json
json_data
=
{};
json_data
[
"
cause"
]
=
0
;
json_data
[
"
smfServiceInstanceId"
]
=
smf_app_inst
->
get_smf_instance_id
()
;
sm_context_response
.
set_json_data
(
json_data
);
sm_context_response
.
set_http_code
(
http_status_code_e
::
HTTP_STATUS_CODE_201_CREATED
);
...
...
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