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;
} }
try { // Transfer N1 to gNB/UE if available
response_data = nlohmann::json::parse(json_data_response); if (number_parts > 1) {
} catch (nlohmann::json::exception& e) { try {
Logger::amf_n11().warn("Could not get Json content from the response"); response_data = nlohmann::json::parse(json_data_response);
// Set the default Cause } catch (nlohmann::json::exception& e) {
response_data["error"]["cause"] = "504 Gateway Timeout"; Logger::amf_n11().warn(
} "Could not get Json content from the response");
// Set the default Cause
Logger::amf_n11().debug( response_data["error"]["cause"] = "504 Gateway Timeout";
"Get response with jsonData: %s", json_data_response.c_str()); }
msg_str_2_msg_hex(
n1sm.substr(0, n1sm.length() - 2),
n1sm_hex); // TODO: pdu session establishment reject bugs from SMF
print_buffer(
"amf_n11", "Get response with n1sm:", (uint8_t*) bdata(n1sm_hex),
blength(n1sm_hex));
std::string cause = response_data["error"]["cause"]; Logger::amf_n11().debug(
Logger::amf_n11().warn( "Get response with jsonData: %s", json_data_response.c_str());
"Call Network Function services failure (with cause %s)", msg_str_2_msg_hex(n1sm, n1sm_hex);
cause.c_str()); print_buffer(
if (!cause.compare("DNN_DENIED")) "amf_n11", "Get response with n1sm:", (uint8_t*) bdata(n1sm_hex),
blength(n1sm_hex));
std::string cause = response_data["error"]["cause"];
Logger::amf_n11().debug(
"Call Network Function services failure (with cause %s)",
cause.c_str());
// 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