Commit 0880e5dd authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Fix issue for HTTP Response code for SessionManagementSubscriptionData

parent 2fefe070
......@@ -44,7 +44,8 @@ SessionManagementSubscriptionDataApiImpl::
SessionManagementSubscriptionDataApiImpl(
std::shared_ptr<Pistache::Rest::Router> rtr, udr_app *udr_app_inst,
std::string address)
: SessionManagementSubscriptionDataApi(rtr), m_udr_app(udr_app_inst),
: SessionManagementSubscriptionDataApi(rtr),
m_udr_app(udr_app_inst),
m_address(address) {}
void SessionManagementSubscriptionDataApiImpl::query_sm_data(
......@@ -75,7 +76,10 @@ void SessionManagementSubscriptionDataApiImpl::query_sm_data(
snssai, dnn_str);
code = static_cast<Pistache::Http::Code>(http_code);
Logger::udr_server().debug("HTTP Response code %d.\n", code);
Logger::udr_server().debug("HTTP response code %ld", http_code);
response.headers().add<Pistache::Http::Header::ContentType>(
Pistache::Http::Mime::MediaType("application/json"));
response.send(code, response_data.dump().c_str());
}
......
......@@ -1509,7 +1509,7 @@ void udr_app::handle_query_sdm_subscriptions(const std::string &ue_id,
//------------------------------------------------------------------------------
void udr_app::handle_query_sm_data(const std::string &ue_id,
const std::string &serving_plmn_id,
nlohmann::json &response_data, long code,
nlohmann::json &response_data, long &code,
oai::udr::model::Snssai snssai,
std::string dnn) {
MYSQL_RES *res = nullptr;
......
......@@ -49,7 +49,7 @@ namespace udr {
namespace app {
class udr_app {
public:
public:
explicit udr_app(const std::string &config_file);
udr_app(udr_app const &) = delete;
void operator=(udr_app const &) = delete;
......@@ -236,7 +236,7 @@ public:
*/
void handle_query_sm_data(const std::string &ue_id,
const std::string &serving_plmn_id,
nlohmann::json &response_data, long code,
nlohmann::json &response_data, long &code,
oai::udr::model::Snssai snssai = {},
std::string dnn = {});
......@@ -249,11 +249,10 @@ public:
* @param [long code] code: HTTP response code
* @return void
*/
void
handle_create_smf_context_non_3gpp(const std::string &ue_id,
const int32_t &pdu_session_id,
const SmfRegistration &smfRegistration,
nlohmann::json &response_data, long &code);
void handle_create_smf_context_non_3gpp(
const std::string &ue_id, const int32_t &pdu_session_id,
const SmfRegistration &smfRegistration, nlohmann::json &response_data,
long &code);
/*
* Handle a request to delete SMFRegistration (SMFRegistrationDocumentApiImpl)
......@@ -304,7 +303,7 @@ public:
const std::string &serving_plmn_id,
nlohmann::json &response_data, long &code);
private:
private:
MYSQL mysql;
};
} // namespace app
......
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