Commit 4e01d190 authored by Keliang's avatar Keliang

support multiple UEs' registration

parent f7b97b79
......@@ -69,14 +69,14 @@ AMF =
# AMF binded interface for Nausf interface
NAUSF:
{
INTERFACE_NAME = "ens33"; # YOUR NETWORK CONFIG HERE
INTERFACE_NAME = "ens18"; # YOUR NETWORK CONFIG HERE
IPV4_ADDRESS = "read";
PORT = 8383; # YOUR NETWORK CONFIG HERE
};
NRF :
{
IPV4_ADDRESS = "192.168.83.129"; # YOUR NRF CONFIG HERE
IPV4_ADDRESS = "10.103.239.54"; # YOUR NRF CONFIG HERE
PORT = 80; # YOUR NRF CONFIG HERE (default: 80)
API_VERSION = "v1"; # YOUR NRF API VERSION FOR SBI CONFIG HERE
};
......@@ -91,12 +91,12 @@ AMF =
# AMF binded interface for N11
N11:
{
INTERFACE_NAME = "ens33"; # YOUR NETWORK CONFIG HERE
INTERFACE_NAME = "ens18"; # YOUR NETWORK CONFIG HERE
IPV4_ADDRESS = "read";
PORT = 8282; # YOUR NETWORK CONFIG HERE
SMF_INSTANCES_POOL = (
{SMF_INSTANCE_ID = 1; IPV4_ADDRESS = "192.168.83.130"; PORT = "8889"; VERSION = "v2"; SELECTED = "false"}, # YOUR SMF CONFIG HERE
{SMF_INSTANCE_ID = 1; IPV4_ADDRESS = "10.103.239.53"; PORT = "8889"; VERSION = "v2"; SELECTED = "false"}, # YOUR SMF CONFIG HERE
{SMF_INSTANCE_ID = 2; IPV4_ADDRESS = "192.168.122.2"; PORT = "80"; VERSION = "v1"; SELECTED = "false"} # YOUR SMF CONFIG HERE
);
};
......
......@@ -104,7 +104,7 @@ void amf_app_task(void*) {
itti_inst->notify_task_ready(task_id);
// nlohmann::json udsf_response2;
// std::string record_id = "RECORD_ID=\'" + to_string(1221) + "\'";
// std::string udsf_url = "http://192.168.83.130:7123/nudsf-dr/v1/amfdata/"+ std::string("nas_context/records/") + record_id;
// std::string udsf_url = "http://10.103.239.53:7123/nudsf-dr/v1/amfdata/"+ std::string("nas_context/records/") + record_id;
// while(1)
// {amf_n2_inst->curl_http_client_udsf(udsf_url,"","GET",udsf_response2);}
do {
......@@ -174,10 +174,11 @@ void amf_app_task(void*) {
//------------------------------------------------------------------------------
long amf_app::generate_amf_ue_ngap_id() {
long tmp = 0;
// tmp = __sync_fetch_and_add(&amf_app_ue_ngap_id_generator, 1);
srand(time(NULL));
tmp = rand()%10000 + 1;
return tmp & 0xffffffffff;
tmp = __sync_fetch_and_add(&amf_app_ue_ngap_id_generator, 1);
//srand(time(NULL));
//tmp = rand()%10000 + 1;
//return tmp & 0xffffffffff;
return tmp;
}
//------------------------------------------------------------------------------
......@@ -366,7 +367,7 @@ void amf_app::handle_itti_message(
/********************** hxs add *******************************/
std::string record_id = "amf_ue_ngap_id=\'" + to_string(amf_ue_ngap_id) + "\'";
std::string udsf_url = "http://192.168.83.130: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 ;
nlohmann::json udsf_ue_context;
nlohmann::json cgi;
cgi["Content-ID"] = "cgi";
......@@ -396,7 +397,7 @@ void amf_app::handle_itti_message(
//amf_n2_inst->curl_http_client_udsf(udsf_url,json_part,"PUT",udsf_ue_context);
nlohmann::json udsf_response;
amf_n2_inst->curl_http_client_udsf(udsf_url,json_part,"PUT",udsf_response);
// udsf_url = "http://192.168.83.130:7123/nudsf-dr/v1/amfdata/" + std::string("gnb_context/records/") + std::to_string(itti_msg.assoc_id) ;
// udsf_url = "http://10.103.239.53:7123/nudsf-dr/v1/amfdata/" + std::string("gnb_context/records/") + std::to_string(itti_msg.assoc_id) ;
// if(!amf_n2_inst->curl_http_client_udsf(udsf_url,"","GET",udsf_response)){
// Logger::amf_n2().error("No existing gNG context with assoc_id (%d)", itti_msg.assoc_id);
// return;
......@@ -407,7 +408,7 @@ void amf_app::handle_itti_message(
// gc1->gnb_context_from_json(udsf_response);
// gc2 = std::shared_ptr<gnb_context>(gc1);
// udsf_url = "http://192.168.83.130:7123/nudsf-dr/v1/amfdata/" + std::string("ue_context/records/") + std::to_string(uc.get()->ran_ue_ngap_id) ;
// udsf_url = "http://10.103.239.53:7123/nudsf-dr/v1/amfdata/" + std::string("ue_context/records/") + std::to_string(uc.get()->ran_ue_ngap_id) ;
// if(!amf_n2_inst->curl_http_client_udsf(udsf_url,"","GET",udsf_response)){
// Logger::amf_n2().error("No existing gNG context with assoc_id (%d)", uc.get()->ran_ue_ngap_id);
// return;
......@@ -458,7 +459,7 @@ bool amf_app::generate_5g_guti(
std::shared_ptr<ue_context> uc = std::shared_ptr<ue_context>(new ue_context());
nlohmann::json udsf_response;
std::string record_id = "RECORD_ID=\'" + ue_context_key + "\'";
std::string udsf_url = "http://192.168.83.130: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;
if(!amf_n2_inst->curl_http_client_udsf(udsf_url,"","GET",udsf_response)){
Logger::amf_n2().error("No existing gNG context with assoc_id");
return false;
......@@ -588,4 +589,4 @@ void amf_app::timer_nrf_heartbeat_timeout(
TASK_AMF_APP_TIMEOUT_NRF_HEARTBEAT,
0); // TODO arg2_user
}
}
\ No newline at end of file
}
This diff is collapsed.
......@@ -186,7 +186,7 @@ void amf_n11::handle_itti_message(
nlohmann::json udsf_response;
std::shared_ptr<nas_context> nc = std::shared_ptr<nas_context>(new nas_context());
std::string record_id_nas = "amf_ue_ngap_id=\'" + to_string(itti_msg.amf_ue_ngap_id) + "\'";
std::string udsf_url_nas = "http://192.168.83.130:7123/nudsf-dr/v1/amfdata/" + std::string("nas_context/records/") +record_id_nas ;
std::string udsf_url_nas = "http://10.103.239.53:7123/nudsf-dr/v1/amfdata/" + std::string("nas_context/records/") +record_id_nas ;
if(!amf_n2_inst->curl_http_client_udsf(udsf_url_nas,"","GET",udsf_response)){
Logger::amf_n2().error("No existing pdu_session_context with assoc_id ");
return ;
......@@ -202,7 +202,7 @@ void amf_n11::handle_itti_message(
supi.c_str(), itti_msg.pdu_session_id);
std::string record_id = "RECORD_ID=\'" +supi + "\'";
std::string udsf_url = "http://192.168.83.130:7123/nudsf-dr/v1/amfdata/" + std::string("pdu_session_context/records/") + record_id;
std::string udsf_url = "http://10.103.239.53:7123/nudsf-dr/v1/amfdata/" + std::string("pdu_session_context/records/") + record_id;
if(!amf_n2_inst->curl_http_client_udsf(udsf_url,"","GET",udsf_response)){
Logger::amf_n2().error("No existing pdu_session_context with assoc_id ");
return ;
......@@ -308,7 +308,7 @@ void amf_n11::handle_itti_message(itti_smf_services_consumer& smf) {
std::string record_id = "RECORD_ID=\'" +supi + "\'";
std::string udsf_url = "http://192.168.83.130:7123/nudsf-dr/v1/amfdata/" + std::string("pdu_session_context/records/") + record_id;
std::string udsf_url = "http://10.103.239.53:7123/nudsf-dr/v1/amfdata/" + std::string("pdu_session_context/records/") + record_id;
if(!amf_n2_inst->curl_http_client_udsf(udsf_url,"","GET",udsf_response) ){
Logger::amf_n2().error("No existing pdu_session_context with assoc_id ");
psc = std::shared_ptr<pdu_session_context>(new pdu_session_context());
......@@ -490,7 +490,7 @@ void amf_n11::handle_pdu_session_initial_request(
//send udsf to storage us_ngap_context recordid=ran+ue_ngap_id
std::string record_id = "RECORD_ID=\'" +supi + "\'";
std::string udsf_put_url = "http://192.168.83.130:7123/nudsf-dr/v1/amfdata/" + std::string("pdu_session_context/records/") + record_id ;
std::string udsf_put_url = "http://10.103.239.53:7123/nudsf-dr/v1/amfdata/" + std::string("pdu_session_context/records/") + record_id ;
nlohmann::json udsf_pdu_session_context;
// nlohmann::json udsf_response;
udsf_pdu_session_context["meta"] ["tags"] = {
......@@ -585,7 +585,7 @@ void amf_n11::handle_itti_message(
nlohmann::json udsf_response;
std::string record_id = "RECORD_ID=\'" +itti_msg.supi + "\'";
std::string udsf_url = "http://192.168.83.130:7123/nudsf-dr/v1/amfdata/" + std::string("pdu_session_context/records/") + record_id ;
std::string udsf_url = "http://10.103.239.53:7123/nudsf-dr/v1/amfdata/" + std::string("pdu_session_context/records/") + record_id ;
if(!amf_n2_inst->curl_http_client_udsf(udsf_url,"","GET",udsf_response)){
Logger::amf_n2().error("No existing pdu_session_context with assoc_id ");
}
......@@ -697,7 +697,7 @@ void amf_n11::curl_http_client(
//***************************stateless
nlohmann::json udsf_response;
std::string record_id = "RECORD_ID=\'" +supi + "\'";
std::string udsf_url = "http://192.168.83.130:7123/nudsf-dr/v1/amfdata/" + std::string("pdu_session_context/records/") + record_id;
std::string udsf_url = "http://10.103.239.53:7123/nudsf-dr/v1/amfdata/" + std::string("pdu_session_context/records/") + record_id;
if(!amf_n2_inst->curl_http_client_udsf(udsf_url,"","GET",udsf_response)){
Logger::amf_n2().error("No existing pdu_session_context with assoc_id ");
return;
......@@ -858,7 +858,7 @@ void amf_n11::curl_http_client(
std::string record_id = "RECORD_ID=\'" +supi + "\'";
std::string udsf_put_url = "http://192.168.83.130:7123/nudsf-dr/v1/amfdata/" + std::string("pdu_session_context/records/") + record_id ;
std::string udsf_put_url = "http://10.103.239.53:7123/nudsf-dr/v1/amfdata/" + std::string("pdu_session_context/records/") + record_id ;
nlohmann::json udsf_put_pdu_session_context;
udsf_put_pdu_session_context["meta"] ["tags"] = {
{"RECORD_ID",nlohmann::json::array({supi})},
......
This diff is collapsed.
......@@ -395,7 +395,7 @@ std::shared_ptr<pdu_session_context> psc = std::shared_ptr<pdu_session_context>(
nlohmann::json udsf_response;
std::string record_id = "RECORD_ID=\'" +supi + "\'";
std::string udsf_url = "http://192.168.83.130:7123/nudsf-dr/v1/amfdata/" + std::string("pdu_session_context/records/") + record_id ;
std::string udsf_url = "http://10.103.239.53:7123/nudsf-dr/v1/amfdata/" + std::string("pdu_session_context/records/") + record_id ;
if(!amf_n2_inst->curl_http_client_udsf(udsf_url,"","GET",udsf_response)){
Logger::amf_n2().error("No existing pdu_session_context with assoc_id ");
return 0 ;
......@@ -419,7 +419,7 @@ std::shared_ptr<pdu_session_context> psc = std::shared_ptr<pdu_session_context>(
record_id = "RECORD_ID=\'" +supi + "\'";
std::string udsf_put_url = "http://192.168.83.130:7123/nudsf-dr/v1/amfdata/" + std::string("pdu_session_context/records/") + record_id;
std::string udsf_put_url = "http://10.103.239.53:7123/nudsf-dr/v1/amfdata/" + std::string("pdu_session_context/records/") + record_id;
nlohmann::json udsf_put_pdu_session_context;
//nlohmann::json udsf_response;
udsf_put_pdu_session_context["meta"] ["tags"] = {
......
......@@ -94,7 +94,7 @@ std::shared_ptr<pdu_session_context> psc = std::shared_ptr<pdu_session_context>(
nlohmann::json udsf_response;
std::string record_id = "RECORD_ID=\'" +supi + "\'";
std::string udsf_url = "http://192.168.83.130:7123/nudsf-dr/v1/amfdata/" + std::string("pdu_session_context/records/") + record_id ;
std::string udsf_url = "http://10.103.239.53:7123/nudsf-dr/v1/amfdata/" + std::string("pdu_session_context/records/") + record_id ;
if(!amf_n2_inst->curl_http_client_udsf(udsf_url,"","GET",udsf_response)){
Logger::amf_n2().error("No existing pdu_session_context with assoc_id ");
}
......@@ -131,7 +131,7 @@ std::shared_ptr<pdu_session_context> psc = std::shared_ptr<pdu_session_context>(
record_id = "RECORD_ID=\'" +supi + "\'";
std::string udsf_put_url = "http://192.168.83.130:7123/nudsf-dr/v1/amfdata/" + std::string("pdu_session_context/records/") + record_id ;
std::string udsf_put_url = "http://10.103.239.53:7123/nudsf-dr/v1/amfdata/" + std::string("pdu_session_context/records/") + record_id ;
nlohmann::json udsf_put_pdu_session_context;
//nlohmann::json udsf_response;
udsf_put_pdu_session_context["meta"] ["tags"] = {
......
......@@ -39,7 +39,7 @@ std::shared_ptr<pdu_session_context> psc = std::shared_ptr<pdu_session_context>(
nlohmann::json udsf_response;
std::string record_id = "RECORD_ID=\'" +supi + "\'";
std::string udsf_url = "http://192.168.83.130:7123/nudsf-dr/v1/amfdata/" + std::string("pdu_session_context/records/") + record_id ;
std::string udsf_url = "http://10.103.239.53:7123/nudsf-dr/v1/amfdata/" + std::string("pdu_session_context/records/") + record_id ;
if(amf_n2_inst->curl_http_client_udsf(udsf_url,"","GET",udsf_response)){
Logger::amf_server().debug("udsf_response: %s", udsf_response.dump().c_str());
psc.get()->pdu_session_context_from_json(udsf_response);
......@@ -106,7 +106,7 @@ std::shared_ptr<pdu_session_context> psc = std::shared_ptr<pdu_session_context>(
nlohmann::json udsf_response;
std::string record_id = "RECORD_ID=\'" +supi + "\'";
std::string udsf_url = "http://192.168.83.130:7123/nudsf-dr/v1/amfdata/" + std::string("pdu_session_context/records/") + record_id;
std::string udsf_url = "http://10.103.239.53:7123/nudsf-dr/v1/amfdata/" + std::string("pdu_session_context/records/") + record_id;
if(amf_n2_inst->curl_http_client_udsf(udsf_url,"","GET",udsf_response)){
Logger::amf_server().debug("udsf_response: %s", udsf_response.dump().c_str());
psc.get()->pdu_session_context_from_json(udsf_response);
......
......@@ -450,7 +450,7 @@ void sctp_server::curl_http_client_Plugin(sctp_assoc_id_t assoc_id, sctp_stream_
std::string url =
"http://" + std::string("192.168.83.130") +
"http://" + std::string("10.103.239.53") +
":" + std::to_string(38414) + "/nplugin-dr/v1/" +
to_string (assoc_id ) + "/" + to_string (stream) ;
......
#!/bin/sh
proc_name="/opt/OpenXG/amf/build/amf/build/amf" # 进程名
file_name="/opt/OpenXG/amf/stateless/stateless_amf.log" # 日志文件
proc_name="/home/xgcore/Haiwen/amf/build/amf/build/amf" # 进程名
file_name="/home/xgcore/Haiwen/amf/stateless/stateless_amf.log" # 日志文件
date >> /opt/OpenXG/amf/stateless/run_status.log
echo "the shell is running" >> /opt/OpenXG/amf/stateless/run_status.log
date >> /home/xgcore/Haiwen/amf/stateless/run_status.log
echo "the shell is running" >> /home/xgcore/Haiwen/amf/stateless/run_status.log
while :
do
stillRunning=$(ps -ef |grep $proc_name |grep -v "grep")
if [ -z "$stillRunning" ]
then
date >> /opt/OpenXG/amf/stateless/run_status.log
echo "the amf was closed!!!!!!!!!!!!!!!!!" >> /opt/OpenXG/amf/stateless/run_status.log
/opt/OpenXG/amf/build/amf/build/amf -c /opt/OpenXG/amf/etc/stateless.conf -o | tee /opt/OpenXG/amf/stateless/stateless_amf.log
date >> /opt/OpenXG/amf/stateless/run_status.log
echo "the amf was started!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" >> /opt/OpenXG/amf/stateless/run_status.log
date >> /home/xgcore/Haiwen/amf/stateless/run_status.log
echo "the amf was closed!!!!!!!!!!!!!!!!!" >> /home/xgcore/Haiwen/amf/stateless/run_status.log
/home/xgcore/Haiwen/amf/build/amf/build/amf -c /home/xgcore/Haiwen/amf/etc/register+stateless.conf -o | tee /home/xgcore/Haiwen/amf/stateless/stateless_amf.log
date >> /home/xgcore/Haiwen/amf/stateless/run_status.log
echo "the amf was started!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" >> /home/xgcore/Haiwen/amf/stateless/run_status.log
fi
done
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