Commit 222896e9 authored by Niuhaiwen's avatar Niuhaiwen

fix bugs for ue_context

parent 8096aaa3
...@@ -316,8 +316,8 @@ void amf_app::handle_itti_message( ...@@ -316,8 +316,8 @@ void amf_app::handle_itti_message(
std::shared_ptr<ue_context> uc = std::shared_ptr<ue_context>(new ue_context()); std::shared_ptr<ue_context> uc = std::shared_ptr<ue_context>(new ue_context());
string ue_context_key = "app_ue_ranid_" + to_string(itti_msg.ran_ue_ngap_id) + "-amfid_" + to_string(amf_ue_ngap_id); string ue_context_key = "app_ue_ranid_" + to_string(itti_msg.ran_ue_ngap_id) + "-amfid_" + to_string(amf_ue_ngap_id);
std::string record_id = "amf_ue_ngap_id=\'" + to_string(amf_ue_ngap_id) + "\'"; std::string record_id = "amf_ue_ngap_id=\'" + to_string(amf_ue_ngap_id) + "\'";
std::string udsf_url = "http://10.103.239.53:7123/nudsf-dr/v1/amfdata/" + std::string("ue_context/records/") + record_id ; //std::string udsf_url = "http://10.103.239.53:7123/nudsf-dr/v1/amfdata/" + std::string("ue_context/records/") + record_id ;
//std::string udsf_url = "http://10.103.239.53:7123/nudsf-dr/v1/amfdata/" + std::string("ue_context/records/") + "RECORD_ID = \'" + ue_context_key + "\'"; std::string udsf_url = "http://10.103.239.53:7123/nudsf-dr/v1/amfdata/" + std::string("ue_context/records/") + "RECORD_ID = \'" + ue_context_key + "\'";
if(!amf_n2_inst->curl_http_client_udsf(udsf_url,"","GET",udsf_response)){ if(!amf_n2_inst->curl_http_client_udsf(udsf_url,"","GET",udsf_response)){
Logger::amf_n2().error("No existing ue_context with ue_context_key ..."); Logger::amf_n2().error("No existing ue_context with ue_context_key ...");
}else if(udsf_response.dump().length()<8){ }else if(udsf_response.dump().length()<8){
...@@ -342,7 +342,8 @@ void amf_app::handle_itti_message( ...@@ -342,7 +342,8 @@ void amf_app::handle_itti_message(
//Update ue_context to UDSF //Update ue_context to UDSF
Logger::amf_app().debug("Update ue_context to UDSF"); Logger::amf_app().debug("Update ue_context to UDSF");
record_id = "amf_ue_ngap_id=\'" + to_string(amf_ue_ngap_id) + "\'"; record_id = "amf_ue_ngap_id=\'" + to_string(amf_ue_ngap_id) + "\'";
udsf_url = "http://10.103.239.53:7123/nudsf-dr/v1/amfdata/" + std::string("ue_context/records/") + record_id ; //udsf_url = "http://10.103.239.53:7123/nudsf-dr/v1/amfdata/" + std::string("ue_context/records/") + record_id ;
udsf_url = "http://10.103.239.53:7123/nudsf-dr/v1/amfdata/" + std::string("ue_context/records/") + "RECORD_ID = \'" + ue_context_key + "\'";
nlohmann::json udsf_ue_context; nlohmann::json udsf_ue_context;
nlohmann::json cgi; nlohmann::json cgi;
cgi["Content-ID"] = "cgi"; cgi["Content-ID"] = "cgi";
...@@ -559,8 +560,10 @@ bool amf_app::generate_5g_guti( ...@@ -559,8 +560,10 @@ bool amf_app::generate_5g_guti(
// uc = ran_amf_id_2_ue_context(ue_context_key); // uc = ran_amf_id_2_ue_context(ue_context_key);
std::shared_ptr<ue_context> uc = std::shared_ptr<ue_context>(new ue_context()); std::shared_ptr<ue_context> uc = std::shared_ptr<ue_context>(new ue_context());
nlohmann::json udsf_response; nlohmann::json udsf_response;
std::string record_id = "RECORD_ID=\'" + ue_context_key + "\'"; std::string record_id = "RECORD_ID=\'" + to_string(amfid) + "\'";
std::string udsf_url = "http://10.103.239.53:7123/nudsf-dr/v1/amfdata/" + std::string("ue_context/records/") + record_id; //std::string record_id = "RECORD_ID=\'" + ue_context_key + "\'";
//std::string udsf_url = "http://10.103.239.53:7123/nudsf-dr/v1/amfdata/" + std::string("ue_context/records/") + record_id;
std::string udsf_url = "http://10.103.239.53:7123/nudsf-dr/v1/amfdata/" + std::string("ue_context/records/") + "RECORD_ID = \'" + ue_context_key + "\'";
if(!amf_n2_inst->curl_http_client_udsf(udsf_url,"","GET",udsf_response)){ if(!amf_n2_inst->curl_http_client_udsf(udsf_url,"","GET",udsf_response)){
Logger::amf_n2().error("No existing gNG context with assoc_id"); Logger::amf_n2().error("No existing gNG context with assoc_id");
return false; return false;
......
...@@ -737,7 +737,7 @@ void amf_n2::handle_itti_message(itti_initial_ue_message& init_ue_msg) { ...@@ -737,7 +737,7 @@ void amf_n2::handle_itti_message(itti_initial_ue_message& init_ue_msg) {
old_ran_ue_ngap_id = ran_ue_ngap_id; old_ran_ue_ngap_id = ran_ue_ngap_id;
else else
old_ran_ue_ngap_id = nc.get()->ran_ue_ngap_id; old_ran_ue_ngap_id = nc.get()->ran_ue_ngap_id;
udsf_put_url = "http://10.103.239.53:7123/nudsf-dr/v1/amfdata/" + std::string("ue_ngap_context/records/") + to_string(old_ran_ue_ngap_id); udsf_put_url = "http://10.103.239.53:7123/nudsf-dr/v1/amfdata/" + std::string("ue_ngap_context/records/") + +"RECORD_ID=\'"+to_string(old_ran_ue_ngap_id)+"\'";
udsf_ue_ngap_context["meta"] ["tags"] = { udsf_ue_ngap_context["meta"] ["tags"] = {
{"RECORD_ID",nlohmann::json::array({to_string(old_ran_ue_ngap_id)})}, {"RECORD_ID",nlohmann::json::array({to_string(old_ran_ue_ngap_id)})},
{"from_nf_ID",nlohmann::json::array({"AMF_1234"})} {"from_nf_ID",nlohmann::json::array({"AMF_1234"})}
......
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