Commit 2026e6ea authored by liuyu's avatar liuyu

change mothed .c_str() ,modify gnb_context model

parent 21860716
......@@ -74,7 +74,7 @@ AMF =
PORT = 8282; # YOUR NETWORK CONFIG HERE
SMF_INSTANCES_POOL = (
{SMF_INSTANCE_ID = 1; IPV4_ADDRESS = "192.168.122.197"; PORT = "8889"; VERSION = "v2"; SELECTED = "true"}, # YOUR SMF CONFIG HERE
{SMF_INSTANCE_ID = 1; IPV4_ADDRESS = " 192.168.70.133"; PORT = "8889"; VERSION = "v2"; SELECTED = "true"}, # YOUR SMF CONFIG HERE
{SMF_INSTANCE_ID = 2; IPV4_ADDRESS = "192.168.122.2"; PORT = "80"; VERSION = "v1"; SELECTED = "false"} # YOUR SMF CONFIG HERE
);
};
......
File added
......@@ -32,7 +32,7 @@
#include <iostream>
#include <cstdlib>
#include "itti.hpp"
#include <nlohmann/json.hpp>
#include "ngap_app.hpp"
#include "amf_config.hpp"
#include "amf_n2.hpp"
......@@ -254,6 +254,37 @@ void amf_app::handle_itti_message(itti_nas_signalling_establishment_request &itt
if (is_guti_valid) {
itti_n1_msg->guti = guti;
}
std::string udsf_url = "http://10.28.234.76:8081/nudsf-dr/v1/amfdata/" + std::string("ue_context/records/") + ue_context_key ;
nlohmann::json udsf_ue_context;
udsf_ue_context["meta"] ["tags"] = {
{"record_id",nlohmann::json::array({ue_context_key})},
{"from_nf_ID",nlohmann::json::array({"AMF_1234"})}
} ;
udsf_ue_context["blocks"] = nlohmann::json::array({
nlohmann::json::object({
{"ran_ue_ngap_id",to_string(uc.get()->ran_ue_ngap_id)},
{"amf_ue_ngap_id",to_string(uc.get()->amf_ue_ngap_id)},
{"isUeContextRequest",to_string(uc.get()->isUeContextRequest)},
{"rrc_estb_cause",to_string(uc.get()->rrc_estb_cause)},
{"cgi", nlohmann::json::object({
{"mcc",uc.get()->cgi.mcc},
{"mnc",uc.get()->cgi.mnc},
{"nrCellID",to_string(uc.get()->cgi.nrCellID)},
})
},
{"tai",nlohmann::json::object({
{"mcc",uc.get()->tai.mcc},
{"mnc",uc.get()->tai.mnc},
{"tac",to_string(uc.get()->tai.tac)},
})
}
})
});
std::string json_part = udsf_ue_context.dump();
amf_n2_inst->curl_http_client_udsf(udsf_url,json_part,"PUT");
std::shared_ptr<itti_uplink_nas_data_ind> i = std::shared_ptr < itti_uplink_nas_data_ind > (itti_n1_msg);
int ret = itti_inst->send_msg(i);
if (0 != ret) {
......
This diff is collapsed.
This diff is collapsed.
......@@ -34,7 +34,9 @@
#include "ue_ngap_context.hpp"
#include "amf.hpp"
namespace amf_application{
#define UDSF_CURL_TIMEOUT_MS 100L
class amf_n2 : public ngap::ngap_app{
public:
......@@ -51,6 +53,9 @@ class amf_n2 : public ngap::ngap_app{
void handle_itti_message(itti_ue_radio_capability_indication &itti_msg);
bool verifyPlmn(std::vector<SupportedItem_t> list);
std::vector<SupportedItem_t> get_common_plmn(std::vector<SupportedItem_t> list);
void curl_http_client_udsf(std::string remoteUri,std::string jsonData,std::string http_mothed) ;
private:
std::map<uint32_t, std::shared_ptr<ue_ngap_context>> ranid2uecontext;// ran ue ngap id
mutable std::shared_mutex m_ranid2uecontext;
......
......@@ -50,7 +50,6 @@ extern void ue_gnb_simulator();
using namespace config;
using namespace amf_application;
amf_config amf_cfg;
amf_modules modules;
itti_mw *itti_inst = nullptr;
......
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