Commit 73eaf564 authored by yangjian's avatar yangjian

update udr databases

parent 1a5c118a
./build/UDR/* ./build/UDR/*
./etc/*
...@@ -49,15 +49,8 @@ void AMF3GPPAccessRegistrationDocumentApiImpl::create_amf_context3gpp( ...@@ -49,15 +49,8 @@ void AMF3GPPAccessRegistrationDocumentApiImpl::create_amf_context3gpp(
MYSQL_RES *res = NULL; MYSQL_RES *res = NULL;
MYSQL_ROW row; MYSQL_ROW row;
std::string tmp_ueId = "";
if (ueId.size() == 15) {
tmp_ueId = "imsi-" + ueId;
} else {
tmp_ueId = ueId;
}
const std::string select_AMF3GPPAccessRegistration = const std::string select_AMF3GPPAccessRegistration =
"select * from Amf3GppAccessRegistration WHERE ueid='" + tmp_ueId + "'"; "select * from Amf3GppAccessRegistration WHERE ueid='" + ueId + "'";
std::string query; std::string query;
nlohmann::json j; nlohmann::json j;
...@@ -171,10 +164,10 @@ void AMF3GPPAccessRegistrationDocumentApiImpl::create_amf_context3gpp( ...@@ -171,10 +164,10 @@ void AMF3GPPAccessRegistrationDocumentApiImpl::create_amf_context3gpp(
query += ",guami='" + j.dump() + "'"; query += ",guami='" + j.dump() + "'";
to_json(j, amf3GppAccessRegistration.getRatType()); to_json(j, amf3GppAccessRegistration.getRatType());
query += ",ratType='" + j.dump() + "'"; query += ",ratType='" + j.dump() + "'";
query += " where ueid='" + tmp_ueId + "'"; query += " where ueid='" + ueId + "'";
} else { } else {
query = query =
"insert into Amf3GppAccessRegistration set ueid='" + tmp_ueId + "'" + "insert into Amf3GppAccessRegistration set ueid='" + ueId + "'" +
",amfInstanceId='" + amf3GppAccessRegistration.getAmfInstanceId() + ",amfInstanceId='" + amf3GppAccessRegistration.getAmfInstanceId() +
"'" + "'" +
(amf3GppAccessRegistration.supportedFeaturesIsSet() (amf3GppAccessRegistration.supportedFeaturesIsSet()
...@@ -297,16 +290,9 @@ void AMF3GPPAccessRegistrationDocumentApiImpl::query_amf_context3gpp( ...@@ -297,16 +290,9 @@ void AMF3GPPAccessRegistrationDocumentApiImpl::query_amf_context3gpp(
nlohmann::json j; nlohmann::json j;
std::string tmp_ueId = "";
if (ueId.size() == 15) {
tmp_ueId = "imsi-" + ueId;
} else {
tmp_ueId = ueId;
}
Amf3GppAccessRegistration amf3gppaccessregistration; Amf3GppAccessRegistration amf3gppaccessregistration;
const std::string query = const std::string query =
"select * from Amf3GppAccessRegistration WHERE ueid='" + tmp_ueId + "'"; "select * from Amf3GppAccessRegistration WHERE ueid='" + ueId + "'";
if (mysql_real_query(mysql_WitcommUDRDB, query.c_str(), if (mysql_real_query(mysql_WitcommUDRDB, query.c_str(),
(unsigned long)query.size())) { (unsigned long)query.size())) {
......
...@@ -41,17 +41,10 @@ void AccessAndMobilitySubscriptionDataDocumentApiImpl::query_am_data( ...@@ -41,17 +41,10 @@ void AccessAndMobilitySubscriptionDataDocumentApiImpl::query_am_data(
nlohmann::json j; nlohmann::json j;
std::string tmp_ueId = "";
if (ueId.size() == 15) {
tmp_ueId = "imsi-" + ueId;
} else {
tmp_ueId = ueId;
}
AccessAndMobilitySubscriptionData accessandmobilitysubscriptiondata; AccessAndMobilitySubscriptionData accessandmobilitysubscriptiondata;
const std::string query = const std::string query =
"select * from AccessAndMobilitySubscriptionData WHERE ueid='" + "select * from AccessAndMobilitySubscriptionData WHERE ueid='" +
tmp_ueId + "' and servingPlmnid='" + servingPlmnId + "'"; ueId + "' and servingPlmnid='" + servingPlmnId + "'";
if (mysql_real_query(mysql_WitcommUDRDB, query.c_str(), if (mysql_real_query(mysql_WitcommUDRDB, query.c_str(),
(unsigned long)query.size())) { (unsigned long)query.size())) {
......
...@@ -33,15 +33,9 @@ void AuthenticationStatusDocumentApiImpl::create_authentication_status( ...@@ -33,15 +33,9 @@ void AuthenticationStatusDocumentApiImpl::create_authentication_status(
// response.send(Pistache::Http::Code::Ok, "create_authentication_status\n"); // response.send(Pistache::Http::Code::Ok, "create_authentication_status\n");
MYSQL_RES *res = NULL; MYSQL_RES *res = NULL;
MYSQL_ROW row; MYSQL_ROW row;
std::string tmp_ueId = "";
if (ueId.size() == 15) {
tmp_ueId = "imsi-" + ueId;
} else {
tmp_ueId = ueId;
}
const std::string select_AuthenticationStatus = const std::string select_AuthenticationStatus =
"select * from AuthenticationStatus WHERE ueid='" + tmp_ueId + "'"; "select * from AuthenticationStatus WHERE ueid='" + ueId + "'";
std::string query; std::string query;
nlohmann::json j; nlohmann::json j;
...@@ -71,9 +65,9 @@ void AuthenticationStatusDocumentApiImpl::create_authentication_status( ...@@ -71,9 +65,9 @@ void AuthenticationStatusDocumentApiImpl::create_authentication_status(
: ""); : "");
// to_json(j,authEvent.getAuthType()); // to_json(j,authEvent.getAuthType());
// query += ",authType='"+j.dump()+"'"; // query += ",authType='"+j.dump()+"'";
query += " where ueid='" + tmp_ueId + "'"; query += " where ueid='" + ueId + "'";
} else { } else {
query = "insert into AuthenticationStatus set ueid='" + tmp_ueId + "'" + query = "insert into AuthenticationStatus set ueid='" + ueId + "'" +
",nfInstanceId='" + authEvent.getNfInstanceId() + "'" + ",nfInstanceId='" + authEvent.getNfInstanceId() + "'" +
",success=" + (authEvent.isSuccess() ? "1" : "0") + ",timeStamp='" + ",success=" + (authEvent.isSuccess() ? "1" : "0") + ",timeStamp='" +
authEvent.getTimeStamp() + "'" + ",authType='" + authEvent.getTimeStamp() + "'" + ",authType='" +
...@@ -103,15 +97,9 @@ void AuthenticationStatusDocumentApiImpl::create_authentication_status( ...@@ -103,15 +97,9 @@ void AuthenticationStatusDocumentApiImpl::create_authentication_status(
void AuthenticationStatusDocumentApiImpl::delete_authentication_status( void AuthenticationStatusDocumentApiImpl::delete_authentication_status(
const std::string &ueId, Pistache::Http::ResponseWriter &response) { const std::string &ueId, Pistache::Http::ResponseWriter &response) {
std::string tmp_ueId = "";
if (ueId.size() == 15) {
tmp_ueId = "imsi-" + ueId;
} else {
tmp_ueId = ueId;
}
const std::string query = const std::string query =
"DELETE from AuthenticationStatus WHERE ueid='" + tmp_ueId + "'"; "DELETE from AuthenticationStatus WHERE ueid='" + ueId + "'";
if (mysql_real_query(mysql_WitcommUDRDB, query.c_str(), if (mysql_real_query(mysql_WitcommUDRDB, query.c_str(),
(unsigned long)query.size())) { (unsigned long)query.size())) {
...@@ -133,16 +121,10 @@ void AuthenticationStatusDocumentApiImpl::query_authentication_status( ...@@ -133,16 +121,10 @@ void AuthenticationStatusDocumentApiImpl::query_authentication_status(
MYSQL_FIELD *field = nullptr; MYSQL_FIELD *field = nullptr;
nlohmann::json j; nlohmann::json j;
std::string tmp_ueId = "";
if (ueId.size() == 15) {
tmp_ueId = "imsi-" + ueId;
} else {
tmp_ueId = ueId;
}
AuthEvent authenticationstatus; AuthEvent authenticationstatus;
const std::string query = const std::string query =
"select * from AuthenticationStatus WHERE ueid='" + tmp_ueId + "'"; "select * from AuthenticationStatus WHERE ueid='" + ueId + "'";
if (mysql_real_query(mysql_WitcommUDRDB, query.c_str(), if (mysql_real_query(mysql_WitcommUDRDB, query.c_str(),
(unsigned long)query.size())) { (unsigned long)query.size())) {
......
...@@ -39,14 +39,9 @@ void AuthenticationSubscriptionDocumentApiImpl:: ...@@ -39,14 +39,9 @@ void AuthenticationSubscriptionDocumentApiImpl::
MYSQL_RES *res = NULL; MYSQL_RES *res = NULL;
MYSQL_ROW row; MYSQL_ROW row;
std::string tmp_ueId = "";
if (ueId.size() == 15) {
tmp_ueId = "imsi-" + ueId;
} else {
tmp_ueId = ueId;
}
const std::string select_Authenticationsubscription = const std::string select_Authenticationsubscription =
"select * from AuthenticationSubscription WHERE ueid='" + tmp_ueId + "'"; "select * from AuthenticationSubscription WHERE ueid='" + ueId + "'";
std::string query; std::string query;
nlohmann::json j, tmp_j; nlohmann::json j, tmp_j;
...@@ -78,7 +73,7 @@ void AuthenticationSubscriptionDocumentApiImpl:: ...@@ -78,7 +73,7 @@ void AuthenticationSubscriptionDocumentApiImpl::
to_json(sequencenumber_j, sequencenumber); to_json(sequencenumber_j, sequencenumber);
query += sequencenumber_j.dump() + "'"; query += sequencenumber_j.dump() + "'";
query += " where ueid='" + tmp_ueId + "'"; query += " where ueid='" + ueId + "'";
} else { } else {
Logger::udr_server().error( Logger::udr_server().error(
"AuthenticationSubscription no data!SQL(%s)", "AuthenticationSubscription no data!SQL(%s)",
...@@ -118,16 +113,10 @@ void AuthenticationSubscriptionDocumentApiImpl:: ...@@ -118,16 +113,10 @@ void AuthenticationSubscriptionDocumentApiImpl::
MYSQL_FIELD *field = nullptr; MYSQL_FIELD *field = nullptr;
nlohmann::json j; nlohmann::json j;
std::string tmp_ueId = "s";
if (ueId.size() == 15) {
tmp_ueId = "imsi-" + ueId;
} else {
tmp_ueId = ueId;
}
AuthenticationSubscription authenticationsubscription; AuthenticationSubscription authenticationsubscription;
const std::string query = const std::string query =
"select * from AuthenticationSubscription WHERE ueid='" + tmp_ueId + "'"; "select * from AuthenticationSubscription WHERE ueid='" + ueId + "'";
if (mysql_real_query(mysql_WitcommUDRDB, query.c_str(), if (mysql_real_query(mysql_WitcommUDRDB, query.c_str(),
(unsigned long)query.size())) { (unsigned long)query.size())) {
......
...@@ -41,18 +41,11 @@ void SDMSubscriptionDocumentApiImpl::querysdm_subscription( ...@@ -41,18 +41,11 @@ void SDMSubscriptionDocumentApiImpl::querysdm_subscription(
MYSQL_ROW row; MYSQL_ROW row;
MYSQL_FIELD *field = nullptr; MYSQL_FIELD *field = nullptr;
std::string tmp_ueId = "";
if (ueId.size() == 15) {
tmp_ueId = "imsi-" + ueId;
} else {
tmp_ueId = ueId;
}
nlohmann::json j; nlohmann::json j;
SdmSubscription SdmSubscriptions; SdmSubscription SdmSubscriptions;
const std::string query = "SELECT * from SdmSubscriptions WHERE ueid='" + const std::string query = "SELECT * from SdmSubscriptions WHERE ueid='" +
tmp_ueId + "' AND subsId=" + subsId; ueId + "' AND subsId=" + subsId;
if (mysql_real_query(mysql_WitcommUDRDB, query.c_str(), if (mysql_real_query(mysql_WitcommUDRDB, query.c_str(),
(unsigned long)query.size())) { (unsigned long)query.size())) {
...@@ -141,19 +134,12 @@ void SDMSubscriptionDocumentApiImpl::removesdm_subscriptions( ...@@ -141,19 +134,12 @@ void SDMSubscriptionDocumentApiImpl::removesdm_subscriptions(
nlohmann::json j; nlohmann::json j;
ProblemDetails problemdetails; ProblemDetails problemdetails;
std::string tmp_ueId = "";
if (ueId.size() == 15) {
tmp_ueId = "imsi-" + ueId;
} else {
tmp_ueId = ueId;
}
const std::string select_query = const std::string select_query =
"SELECT * from SdmSubscriptions WHERE ueid='" + tmp_ueId + "SELECT * from SdmSubscriptions WHERE ueid='" + ueId +
"' AND subsId=" + subsId; "' AND subsId=" + subsId;
const std::string query = "DELETE from SdmSubscriptions WHERE ueid='" + const std::string query = "DELETE from SdmSubscriptions WHERE ueid='" +
tmp_ueId + "' AND subsId=" + subsId; ueId + "' AND subsId=" + subsId;
if (mysql_real_query(mysql_WitcommUDRDB, select_query.c_str(), if (mysql_real_query(mysql_WitcommUDRDB, select_query.c_str(),
(unsigned long)select_query.size())) { (unsigned long)select_query.size())) {
...@@ -201,15 +187,8 @@ void SDMSubscriptionDocumentApiImpl::updatesdmsubscriptions( ...@@ -201,15 +187,8 @@ void SDMSubscriptionDocumentApiImpl::updatesdmsubscriptions(
MYSQL_RES *res = NULL; MYSQL_RES *res = NULL;
MYSQL_ROW row; MYSQL_ROW row;
std::string tmp_ueId = "";
if (ueId.size() == 15) {
tmp_ueId = "imsi-" + ueId;
} else {
tmp_ueId = ueId;
}
const std::string select_query = const std::string select_query =
"SELECT * from SdmSubscriptions WHERE ueid='" + tmp_ueId + "SELECT * from SdmSubscriptions WHERE ueid='" + ueId +
"' AND subsId=" + subsId; "' AND subsId=" + subsId;
std::string query; std::string query;
nlohmann::json j; nlohmann::json j;
...@@ -282,7 +261,7 @@ void SDMSubscriptionDocumentApiImpl::updatesdmsubscriptions( ...@@ -282,7 +261,7 @@ void SDMSubscriptionDocumentApiImpl::updatesdmsubscriptions(
query += query +=
",monitoredResourceUris='" + MonitoredResourceUris_json.dump() + "'"; ",monitoredResourceUris='" + MonitoredResourceUris_json.dump() + "'";
query += " where ueid='" + tmp_ueId + "' AND subsId=" + subsId; query += " where ueid='" + ueId + "' AND subsId=" + subsId;
} else { } else {
to_json(j, problemdetails); to_json(j, problemdetails);
response.send(Pistache::Http::Code::Not_Found, j.dump()); response.send(Pistache::Http::Code::Not_Found, j.dump());
......
...@@ -34,17 +34,10 @@ void SDMSubscriptionsCollectionApiImpl::create_sdm_subscriptions( ...@@ -34,17 +34,10 @@ void SDMSubscriptionsCollectionApiImpl::create_sdm_subscriptions(
MYSQL_ROW row; MYSQL_ROW row;
nlohmann::json j; nlohmann::json j;
std::string tmp_ueId = "";
if (ueId.size() == 15) {
tmp_ueId = "imsi-" + ueId;
} else {
tmp_ueId = ueId;
}
int32_t subsId = 0; int32_t subsId = 0;
int32_t count = 0; int32_t count = 0;
std::string query = std::string query =
"SELECT subsId from SdmSubscriptions WHERE ueid='" + tmp_ueId + "'"; "SELECT subsId from SdmSubscriptions WHERE ueid='" + ueId + "'";
if (mysql_real_query(mysql_WitcommUDRDB, query.c_str(), if (mysql_real_query(mysql_WitcommUDRDB, query.c_str(),
(unsigned long)query.size())) { (unsigned long)query.size())) {
Logger::udr_server().error("mysql_real_query failure!SQL(%s)", Logger::udr_server().error("mysql_real_query failure!SQL(%s)",
...@@ -70,7 +63,7 @@ void SDMSubscriptionsCollectionApiImpl::create_sdm_subscriptions( ...@@ -70,7 +63,7 @@ void SDMSubscriptionsCollectionApiImpl::create_sdm_subscriptions(
//****** add query ******* //****** add query *******
query = query =
"insert into SdmSubscriptions set ueid='" + tmp_ueId + "'" + "insert into SdmSubscriptions set ueid='" + ueId + "'" +
",nfInstanceId='" + sdmSubscription.getNfInstanceId() + "'" + ",nfInstanceId='" + sdmSubscription.getNfInstanceId() + "'" +
(sdmSubscription.implicitUnsubscribeIsSet() (sdmSubscription.implicitUnsubscribeIsSet()
? (sdmSubscription.isImplicitUnsubscribe() ? (sdmSubscription.isImplicitUnsubscribe()
...@@ -152,15 +145,8 @@ void SDMSubscriptionsCollectionApiImpl::querysdmsubscriptions( ...@@ -152,15 +145,8 @@ void SDMSubscriptionsCollectionApiImpl::querysdmsubscriptions(
nlohmann::json j, tmp; nlohmann::json j, tmp;
std::string tmp_ueId = "";
if (ueId.size() == 15) {
tmp_ueId = "imsi-" + ueId;
} else {
tmp_ueId = ueId;
}
const std::string query = const std::string query =
"SELECT * from SdmSubscriptions WHERE ueid='" + tmp_ueId + "'"; "SELECT * from SdmSubscriptions WHERE ueid='" + ueId + "'";
if (mysql_real_query(mysql_WitcommUDRDB, query.c_str(), if (mysql_real_query(mysql_WitcommUDRDB, query.c_str(),
(unsigned long)query.size())) { (unsigned long)query.size())) {
......
...@@ -34,15 +34,8 @@ void SMFRegistrationDocumentApiImpl::create_smf_context_non3gpp( ...@@ -34,15 +34,8 @@ void SMFRegistrationDocumentApiImpl::create_smf_context_non3gpp(
MYSQL_RES *res = NULL; MYSQL_RES *res = NULL;
MYSQL_ROW row; MYSQL_ROW row;
std::string tmp_ueId = "";
if (ueId.size() == 15) {
tmp_ueId = "imsi-" + ueId;
} else {
tmp_ueId = ueId;
}
const std::string select_SmfRegistration = const std::string select_SmfRegistration =
"SELECT * from SmfRegistrations WHERE ueid='" + tmp_ueId + "SELECT * from SmfRegistrations WHERE ueid='" + ueId +
"' AND subpduSessionId=" + std::to_string(pduSessionId); "' AND subpduSessionId=" + std::to_string(pduSessionId);
std::string query; std::string query;
nlohmann::json j; nlohmann::json j;
...@@ -110,11 +103,11 @@ void SMFRegistrationDocumentApiImpl::create_smf_context_non3gpp( ...@@ -110,11 +103,11 @@ void SMFRegistrationDocumentApiImpl::create_smf_context_non3gpp(
query += ",singleNssai='" + j.dump() + "'"; query += ",singleNssai='" + j.dump() + "'";
to_json(j, smfRegistration.getPlmnId()); to_json(j, smfRegistration.getPlmnId());
query += ",plmnId='" + j.dump() + "'"; query += ",plmnId='" + j.dump() + "'";
query += " where ueid='" + tmp_ueId + query += " where ueid='" + ueId +
"' AND subpduSessionId=" + std::to_string(pduSessionId); "' AND subpduSessionId=" + std::to_string(pduSessionId);
} else { } else {
query = query =
"insert into SmfRegistrations set ueid='" + tmp_ueId + "'" + "insert into SmfRegistrations set ueid='" + ueId + "'" +
",subpduSessionId=" + std::to_string(pduSessionId) + ",subpduSessionId=" + std::to_string(pduSessionId) +
",pduSessionId=" + std::to_string(smfRegistration.getPduSessionId()) + ",pduSessionId=" + std::to_string(smfRegistration.getPduSessionId()) +
",smfInstanceId='" + smfRegistration.getSmfInstanceId() + "'" + ",smfInstanceId='" + smfRegistration.getSmfInstanceId() + "'" +
...@@ -184,15 +177,9 @@ void SMFRegistrationDocumentApiImpl::create_smf_context_non3gpp( ...@@ -184,15 +177,9 @@ void SMFRegistrationDocumentApiImpl::create_smf_context_non3gpp(
void SMFRegistrationDocumentApiImpl::delete_smf_context( void SMFRegistrationDocumentApiImpl::delete_smf_context(
const std::string &ueId, const int32_t &pduSessionId, const std::string &ueId, const int32_t &pduSessionId,
Pistache::Http::ResponseWriter &response) { Pistache::Http::ResponseWriter &response) {
std::string tmp_ueId = "";
if (ueId.size() == 15) {
tmp_ueId = "imsi-" + ueId;
} else {
tmp_ueId = ueId;
}
const std::string query = const std::string query =
"DELETE from SmfRegistrations WHERE ueid='" + tmp_ueId + "DELETE from SmfRegistrations WHERE ueid='" + ueId +
"' AND subpduSessionId=" + std::to_string(pduSessionId); "' AND subpduSessionId=" + std::to_string(pduSessionId);
if (mysql_real_query(mysql_WitcommUDRDB, query.c_str(), if (mysql_real_query(mysql_WitcommUDRDB, query.c_str(),
...@@ -214,18 +201,11 @@ void SMFRegistrationDocumentApiImpl::query_smf_registration( ...@@ -214,18 +201,11 @@ void SMFRegistrationDocumentApiImpl::query_smf_registration(
MYSQL_ROW row; MYSQL_ROW row;
MYSQL_FIELD *field = nullptr; MYSQL_FIELD *field = nullptr;
std::string tmp_ueId = "";
if (ueId.size() == 15) {
tmp_ueId = "imsi-" + ueId;
} else {
tmp_ueId = ueId;
}
nlohmann::json j; nlohmann::json j;
SmfRegistration smfregistration; SmfRegistration smfregistration;
const std::string query = const std::string query =
"SELECT * from SmfRegistrations WHERE ueid='" + tmp_ueId + "SELECT * from SmfRegistrations WHERE ueid='" + ueId +
"' AND subpduSessionId=" + std::to_string(pduSessionId); "' AND subpduSessionId=" + std::to_string(pduSessionId);
if (mysql_real_query(mysql_WitcommUDRDB, query.c_str(), if (mysql_real_query(mysql_WitcommUDRDB, query.c_str(),
......
...@@ -35,19 +35,12 @@ void SMFRegistrationsCollectionApiImpl::query_smf_reg_list( ...@@ -35,19 +35,12 @@ void SMFRegistrationsCollectionApiImpl::query_smf_reg_list(
MYSQL_ROW row; MYSQL_ROW row;
MYSQL_FIELD *field = nullptr; MYSQL_FIELD *field = nullptr;
std::string tmp_ueId = "";
if (ueId.size() == 15) {
tmp_ueId = "imsi-" + ueId;
} else {
tmp_ueId = ueId;
}
std::vector<std::string> fields; std::vector<std::string> fields;
nlohmann::json j, tmp; nlohmann::json j, tmp;
const std::string query = const std::string query =
"SELECT * from SmfRegistrations WHERE ueid='" + tmp_ueId + "'"; "SELECT * from SmfRegistrations WHERE ueid='" + ueId + "'";
if (mysql_real_query(mysql_WitcommUDRDB, query.c_str(), if (mysql_real_query(mysql_WitcommUDRDB, query.c_str(),
(unsigned long)query.size())) { (unsigned long)query.size())) {
......
...@@ -41,16 +41,9 @@ void SMFSelectionSubscriptionDataDocumentApiImpl::query_smf_select_data( ...@@ -41,16 +41,9 @@ void SMFSelectionSubscriptionDataDocumentApiImpl::query_smf_select_data(
nlohmann::json j; nlohmann::json j;
std::string tmp_ueId = "";
if (ueId.size() == 15) {
tmp_ueId = "imsi-" + ueId;
} else {
tmp_ueId = ueId;
}
SmfSelectionSubscriptionData smfselectionsubscriptiondata; SmfSelectionSubscriptionData smfselectionsubscriptiondata;
const std::string query = const std::string query =
"select * from SmfSelectionSubscriptionData WHERE ueid='" + tmp_ueId + "select * from SmfSelectionSubscriptionData WHERE ueid='" + ueId +
"' and servingPlmnid='" + servingPlmnId + "'"; "' and servingPlmnid='" + servingPlmnId + "'";
if (mysql_real_query(mysql_WitcommUDRDB, query.c_str(), if (mysql_real_query(mysql_WitcommUDRDB, query.c_str(),
......
...@@ -45,17 +45,10 @@ void SessionManagementSubscriptionDataApiImpl::query_sm_data( ...@@ -45,17 +45,10 @@ void SessionManagementSubscriptionDataApiImpl::query_sm_data(
nlohmann::json j; nlohmann::json j;
std::string tmp_ueId = "";
if (ueId.size() == 15) {
tmp_ueId = "imsi-" + ueId;
} else {
tmp_ueId = ueId;
}
SessionManagementSubscriptionData sessionmanagementsubscriptiondata; SessionManagementSubscriptionData sessionmanagementsubscriptiondata;
const std::string query = const std::string query =
"select * from SessionManagementSubscriptionData WHERE ueid='" + "select * from SessionManagementSubscriptionData WHERE ueid='" +
tmp_ueId + "' and servingPlmnid='" + servingPlmnId + "'"; ueId + "' and servingPlmnid='" + servingPlmnId + "'";
if (mysql_real_query(mysql_WitcommUDRDB, query.c_str(), if (mysql_real_query(mysql_WitcommUDRDB, query.c_str(),
(unsigned long)query.size())) { (unsigned long)query.size())) {
......
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