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

Fix issue for PDU session establishment reject

parent 961172b4
...@@ -581,8 +581,11 @@ void amf_n11::curl_http_client( ...@@ -581,8 +581,11 @@ void amf_n11::curl_http_client(
bstring n1sm_hex, n2sm_hex; bstring n1sm_hex, n2sm_hex;
Logger::amf_n11().debug("Get response with HTTP code (%d)", httpCode); Logger::amf_n11().debug("Get response with HTTP code (%d)", httpCode);
Logger::amf_n11().debug("Response body %s", response.c_str());
if (static_cast<http_response_codes_e>(httpCode) == if (static_cast<http_response_codes_e>(httpCode) ==
http_response_codes_e::HTTP_RESPONSE_CODE_0) { http_response_codes_e::HTTP_RESPONSE_CODE_0) {
// TODO: should be removed
Logger::amf_n11().error( Logger::amf_n11().error(
"Cannot get response when calling %s", remoteUri.c_str()); "Cannot get response when calling %s", remoteUri.c_str());
// free curl before returning // free curl before returning
...@@ -618,30 +621,33 @@ void amf_n11::curl_http_client( ...@@ -618,30 +621,33 @@ void amf_n11::curl_http_client(
return; return;
} }
// Transfer N1 to gNB/UE if available
if (number_parts > 1) {
try { try {
response_data = nlohmann::json::parse(json_data_response); response_data = nlohmann::json::parse(json_data_response);
} catch (nlohmann::json::exception& e) { } catch (nlohmann::json::exception& e) {
Logger::amf_n11().warn("Could not get Json content from the response"); Logger::amf_n11().warn(
"Could not get Json content from the response");
// Set the default Cause // Set the default Cause
response_data["error"]["cause"] = "504 Gateway Timeout"; response_data["error"]["cause"] = "504 Gateway Timeout";
} }
Logger::amf_n11().debug( Logger::amf_n11().debug(
"Get response with jsonData: %s", json_data_response.c_str()); "Get response with jsonData: %s", json_data_response.c_str());
msg_str_2_msg_hex( msg_str_2_msg_hex(n1sm, n1sm_hex);
n1sm.substr(0, n1sm.length() - 2),
n1sm_hex); // TODO: pdu session establishment reject bugs from SMF
print_buffer( print_buffer(
"amf_n11", "Get response with n1sm:", (uint8_t*) bdata(n1sm_hex), "amf_n11", "Get response with n1sm:", (uint8_t*) bdata(n1sm_hex),
blength(n1sm_hex)); blength(n1sm_hex));
std::string cause = response_data["error"]["cause"]; std::string cause = response_data["error"]["cause"];
Logger::amf_n11().warn( Logger::amf_n11().debug(
"Call Network Function services failure (with cause %s)", "Call Network Function services failure (with cause %s)",
cause.c_str()); cause.c_str());
if (!cause.compare("DNN_DENIED")) // if (!cause.compare("DNN_DENIED"))
handle_post_sm_context_response_error( handle_post_sm_context_response_error(
httpCode, cause, n1sm_hex, supi, pdu_session_id); httpCode, cause, n1sm_hex, supi, pdu_session_id);
}
} else { // Response with success code } else { // Response with success code
// Store location of the created context in case of PDU Session // Store location of the created context in case of PDU Session
// Establishment // Establishment
......
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