Commit 48953689 authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Fix issue for processing response from AUSF

parent 161a9f7c
...@@ -3702,7 +3702,8 @@ bool amf_n1::reroute_registration_request(std::shared_ptr<nas_context>& nc) { ...@@ -3702,7 +3702,8 @@ bool amf_n1::reroute_registration_request(std::shared_ptr<nas_context>& nc) {
// re-allocation procedure will be executed to reroute the Registration " // re-allocation procedure will be executed to reroute the Registration "
// Request to an appropriate AMF // Request to an appropriate AMF
Logger::amf_n1().debug("Verifying whether this AMF can handle the request"); Logger::amf_n1().debug(
"Verifying whether this AMF can handle the request...");
/* /*
// Check if the AMF can serve all the requested S-NSSAIs // Check if the AMF can serve all the requested S-NSSAIs
...@@ -3727,7 +3728,7 @@ bool amf_n1::reroute_registration_request(std::shared_ptr<nas_context>& nc) { ...@@ -3727,7 +3728,7 @@ bool amf_n1::reroute_registration_request(std::shared_ptr<nas_context>& nc) {
// Check that AMF can process the Requested NSSAIs or not // Check that AMF can process the Requested NSSAIs or not
if (check_subscribed_nssai(nc, nssai)) { if (check_subscribed_nssai(nc, nssai)) {
Logger::amf_n1().debug( Logger::amf_n1().debug(
"Current AMF can handle the Requested/Subscribed NSSAIs, do not need " "Current AMF can handle the Requested/Subscribed NSSAIs, no need "
"to perform AMF Re-allocation procedure"); "to perform AMF Re-allocation procedure");
return false; return false;
} }
......
...@@ -1747,28 +1747,18 @@ void amf_n11::curl_http_client( ...@@ -1747,28 +1747,18 @@ void amf_n11::curl_http_client(
response_json = {}; response_json = {};
return; return;
} }
// Get the ProblemDetails }
try {
response_json = nlohmann::json::parse(response);
} catch (nlohmann::json::exception& e) {
Logger::amf_n11().info("Could not get JSON content from the response");
response_json = {};
}
Logger::amf_n11().debug("Response code %d", httpCode); try {
return; response_json = nlohmann::json::parse(response);
} catch (nlohmann::json::exception& e) {
Logger::amf_n11().info("Could not get JSON content from the response");
response_json = {};
} }
if (!is_response_ok) { Logger::amf_n11().info(
try { "Get response with Json content: %s", response_json.dump().c_str());
response_json = nlohmann::json::parse(response);
} catch (nlohmann::json::exception& e) {
Logger::amf_n11().info("Could not get JSON content from the response");
}
Logger::amf_n11().info(
"Get response with Json content: %s", response_json.dump().c_str());
}
curl_slist_free_all(headers); curl_slist_free_all(headers);
curl_easy_cleanup(curl); curl_easy_cleanup(curl);
} }
......
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