Commit 74031dae authored by Raphael Defosseux's avatar Raphael Defosseux

Merge branch 'fix_api_version' into 'develop'

Temporary get API version from Conf file in case of FQDN

See merge request oai/cn5g/oai-cn5g-ausf!13
parents 844a11a3 d906a5b1
......@@ -200,18 +200,18 @@ void ausf_app::handle_ue_authentications(
} catch (nlohmann::json::exception& e) {
// TODO: Catch parse_error exception
// TODO: Catch out_of_range exception
Logger::ausf_app().info("Could not Parse Json content from UDM response");
Logger::ausf_app().info("Could not Parse JSON content from UDM response");
// TODO: error handling
problemDetails.setCause("CONTEXT_NOT_FOUND");
problemDetails.setStatus(404);
problemDetails.setDetail(
"Resource corresponding to User " + supi + " not found in UDM");
"Resource corresponding to User " + supi + " not found");
to_json(problemDetails_json, problemDetails);
Logger::ausf_app().error(
"Resource corresponding to User %s not found in UDM", supi.c_str());
Logger::ausf_app().info("Send 404 Not_Found response to AUSF");
"Resource corresponding to User %s not found", supi.c_str());
Logger::ausf_app().info("Send 404 Not_Found response");
code = Pistache::Http::Code::Not_Found;
json_data = problemDetails_json;
return;
......@@ -362,7 +362,7 @@ void ausf_app::handle_ue_authentications_confirmation(
to_json(problemDetails_json, problemDetails);
Logger::ausf_app().error("Serving Network Not Authorized");
Logger::ausf_app().info("Send 403 Forbidden response to AUSF");
Logger::ausf_app().info("Send 403 Forbidden response");
code = Pistache::Http::Code::Forbidden;
json_data = problemDetails_json;
return;
......
......@@ -125,7 +125,7 @@ void ausf_client::curl_http_client(
// Process the response
response = *httpData.get();
bool is_response_ok = true;
Logger::ausf_app().info("Get response with httpcode (%d)", httpCode);
Logger::ausf_app().info("Get response with HTTP code (%d)", httpCode);
if (httpCode == 0) {
Logger::ausf_app().info(
......@@ -147,7 +147,7 @@ void ausf_client::curl_http_client(
// TODO: send context response error
return;
}
Logger::ausf_app().warn("Receive response with Http Code %d", httpCode);
Logger::ausf_app().warn("Receive response with HTTP code %d", httpCode);
return;
}
......@@ -155,7 +155,7 @@ void ausf_client::curl_http_client(
try {
response_data = nlohmann::json::parse(response);
} catch (nlohmann::json::exception& e) {
Logger::ausf_app().info("Could not get Json content from the response");
Logger::ausf_app().info("Could not get JSON content from the response");
// Set the default Cause
response_data["error"]["cause"] = "504 Gateway Timeout";
}
......
......@@ -188,10 +188,17 @@ int ausf_config::load(const std::string& config_file) {
IPV4_STR_ADDR_TO_INADDR(
util::trim(address).c_str(), udm_ipv4_addr,
"BAD IPv4 ADDRESS FORMAT FOR NRF !");
udm_addr.ipv4_addr = udm_ipv4_addr;
udm_addr.port = udm_port;
udm_addr.api_version = "v1"; // TODO: to get API version from DNS
udm_addr.fqdn = astring;
udm_addr.ipv4_addr = udm_ipv4_addr;
udm_addr.port = udm_port;
std::string udm_api_version = {};
if (!(udm_cfg.lookupValue(
AUSF_CONFIG_STRING_API_VERSION, udm_api_version))) {
Logger::ausf_app().error(AUSF_CONFIG_STRING_API_VERSION "failed");
throw(AUSF_CONFIG_STRING_API_VERSION "failed");
}
udm_addr.api_version =
udm_api_version; // TODO: to get API version from DNS
udm_addr.fqdn = astring;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment