Commit 3fb09c01 authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Fix issue for Notify URI

parent 958517d9
...@@ -124,7 +124,8 @@ void event_exposure_msg::set_any_ue(bool value) { ...@@ -124,7 +124,8 @@ void event_exposure_msg::set_any_ue(bool value) {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void event_notification::set_notify_correlation_id(std::string const& value) { void event_notification::set_notify_correlation_id(std::string const& value) {
m_notify_correlation_id = value; m_notify_correlation_id = value;
m_notify_correlation_is_set = true;
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
...@@ -132,6 +133,15 @@ std::string event_notification::get_notify_correlation_id() const { ...@@ -132,6 +133,15 @@ std::string event_notification::get_notify_correlation_id() const {
return m_notify_correlation_id; return m_notify_correlation_id;
} }
void event_notification::set_notify_uri(std::string const& value) {
m_notify_uri = value;
m_notify_uri_is_set = true;
}
std::string event_notification::get_notify_uri() const {
return m_notify_uri;
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void event_notification::set_subs_change_notify_correlation_id( void event_notification::set_subs_change_notify_correlation_id(
std::string const& value) { std::string const& value) {
......
...@@ -87,6 +87,10 @@ class event_notification { ...@@ -87,6 +87,10 @@ class event_notification {
public: public:
void set_notify_correlation_id(std::string const& value); void set_notify_correlation_id(std::string const& value);
std::string get_notify_correlation_id() const; std::string get_notify_correlation_id() const;
void set_notify_uri(std::string const& value);
std::string get_notify_uri() const;
void set_subs_change_notify_correlation_id(std::string const& value); void set_subs_change_notify_correlation_id(std::string const& value);
std::string get_subs_change_notify_correlation_id() const; std::string get_subs_change_notify_correlation_id() const;
void add_report(const oai::amf::model::AmfEventReport& report); void add_report(const oai::amf::model::AmfEventReport& report);
...@@ -95,6 +99,10 @@ class event_notification { ...@@ -95,6 +99,10 @@ class event_notification {
private: private:
std::string m_notify_correlation_id; // notifyCorrelationId std::string m_notify_correlation_id; // notifyCorrelationId
bool m_notify_correlation_is_set; bool m_notify_correlation_is_set;
std::string m_notify_uri; // notifyUri
bool m_notify_uri_is_set;
std::string std::string
m_subs_change_notify_correlation_id; // SubsChangeNotifyCorrelationId; m_subs_change_notify_correlation_id; // SubsChangeNotifyCorrelationId;
bool m_subs_change_notify_correlation_id_is_set; bool m_subs_change_notify_correlation_id_is_set;
......
...@@ -3368,6 +3368,7 @@ void amf_n1::handle_ue_connectivity_state_change( ...@@ -3368,6 +3368,7 @@ void amf_n1::handle_ue_connectivity_state_change(
for (auto i : subscriptions) { for (auto i : subscriptions) {
event_notification ev_notif = {}; event_notification ev_notif = {};
ev_notif.set_notify_correlation_id(i.get()->notify_correlation_id); ev_notif.set_notify_correlation_id(i.get()->notify_correlation_id);
ev_notif.set_notify_uri(i.get()->notify_uri); // Direct subscription
// ev_notif.set_subs_change_notify_correlation_id(i.get()->notify_uri); // ev_notif.set_subs_change_notify_correlation_id(i.get()->notify_uri);
oai::amf::model::AmfEventReport event_report = {}; oai::amf::model::AmfEventReport event_report = {};
......
...@@ -564,7 +564,7 @@ void amf_n11::handle_itti_message(itti_sbi_notify_subscribed_event& itti_msg) { ...@@ -564,7 +564,7 @@ void amf_n11::handle_itti_message(itti_sbi_notify_subscribed_event& itti_msg) {
std::string body = json_data.dump(); std::string body = json_data.dump();
std::string response_data; std::string response_data;
std::string url = i.get_notify_correlation_id(); std::string url = i.get_notify_uri();
curl_http_client(url, "POST", body, response_data); curl_http_client(url, "POST", body, response_data);
// TODO: process the response // TODO: process the response
} }
...@@ -1358,7 +1358,6 @@ void amf_n11::curl_http_client( ...@@ -1358,7 +1358,6 @@ void amf_n11::curl_http_client(
std::string remoteUri, std::string method, std::string msgBody, std::string remoteUri, std::string method, std::string msgBody,
std::string& response, uint8_t http_version) { std::string& response, uint8_t http_version) {
Logger::amf_n11().info("Send HTTP message to %s", remoteUri.c_str()); Logger::amf_n11().info("Send HTTP message to %s", remoteUri.c_str());
Logger::amf_n11().info("HTTP message Body: %s", msgBody.c_str()); Logger::amf_n11().info("HTTP message Body: %s", msgBody.c_str());
uint32_t str_len = msgBody.length(); uint32_t str_len = msgBody.length();
......
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