Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change default open5gs server/client type to HTTP/1.1 #11

Merged
merged 2 commits into from
Oct 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,52 @@ The Application Function can be executed with the command:
rt-5gms-application-function/src/5gmsaf$ ../../install/bin/open5gs-msafd -c msaf.yaml
```

## Testing with the example configuration

If you started the 5GMS Application Function with the example configuration, you can test it by retrieving {http://127.0.0.22:7777/3gpp-m5/v2/service-access-information/d54a1fcc-d411-4e32-807b-2c60dbaeaf5f}.

For example:
```bash
curl -v http://127.0.0.22:7777/3gpp-m5/v2/service-access-information/d54a1fcc-d411-4e32-807b-2c60dbaeaf5f
```
...would receive a response like:
```
< HTTP/1.1 200 OK
< Date: Fri, 28 Oct 2022 16:26:09 GMT
< Connection: close
< Content-Type: application/json
< Content-Length: 278
<
{
"provisioningSessionId": "d54a1fcc-d411-4e32-807b-2c60dbaeaf5f",
"provisioningSessionType": "DOWNLINK",
"streamingAccess": {
"mediaPlayerEntry": "https://localhost/m4d/provisioning-session-d54a1fcc-d411-4e32-807b-2c60dbaeaf5f/BigBuckBunny_4s_onDemand_2014_05_09.mpd"
}
}
```

The not found response can be tested using a different provisioningSessionId string to the value in the provisioningSessionId key in the configuration YAML file. For example
```bash
curl -v http://127.0.0.22:7777/3gpp-m5/v2/service-access-information/does_not_exist
```
...which would receive a response like:
```
< HTTP/1.1 404 Not Found
< Date: Fri, 28 Oct 2022 16:26:28 GMT
< Connection: close
< Content-Type: application/problem+json
< Content-Length: 218
<
{
"type": "/3gpp-m5/v2",
"title": "Service Access Information not found",
"status": 404,
"detail": "Service Access Information does_not_exist not found.",
"instance": "/service-access-information/does_not_exist"
}
```

## Development

_TODO_
2 changes: 2 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@ project('rt-5gms-af', 'c',
'c_std=gnu89',
],
)
sh_cmd = find_program('sh')
patch_open5gs_result = run_command([sh_cmd, '-c', '"$MESON_SOURCE_ROOT/subprojects/patch_open5gs.sh" open5gs'], check: true, capture: false)
open5gs_project=subproject('open5gs',required:true)
subdir('src')
38 changes: 38 additions & 0 deletions subprojects/patch_open5gs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/sh
#==============================================================================
# 5G-MAG Reference Tools - Open5GS apply patches
#==============================================================================
# Author: David Waring
# License: 5G-MAG Public License (v1.0)
# Copyright: ©2022 British Broadcasting Corporation
#
# For full license terms please see the LICENSE file distributed with this
# program. If this file is missing then the license can be retrieved from
# https://drive.google.com/file/d/1cinCiA778IErENZ3JN52VFW-1ffHpx7Z/view
#==============================================================================

cd `dirname "$0"`

open5gs_src=`realpath "$1"`
patch_cmd=`which patch`

if ! grep -q '/\* rt-5gms-applicatiopn-function patch applied \*/' "$open5gs_src/lib/sbi/server.c"; then
(cd "$open5gs_src"; "$patch_cmd" -p1 <<EOF
--- open5gs.orig/lib/sbi/server.c 2022-10-28 09:40:30.867621595 +0100
+++ open5gs/lib/sbi/server.c 2022-10-28 09:41:38.004798078 +0100
@@ -30,9 +30,9 @@
void ogs_sbi_server_init(int num_of_session_pool, int num_of_stream_pool)
{
if (ogs_sbi_server_actions_initialized == false) {
-#if 1 /* Use HTTP2 */
+#if 0 /* Use HTTP2 */ /* rt-5gms-applicatiopn-function patch applied */
ogs_sbi_server_actions = ogs_nghttp2_server_actions;
-#else
+#else /* Use HTTP/1.1 */
ogs_sbi_server_actions = ogs_mhd_server_actions;
#endif
}
EOF
)
fi
exit 0