Skip to content

Commit

Permalink
Add msisdn to directoryd session info (#2539)
Browse files Browse the repository at this point in the history
Signed-off-by: Nick Yurchenko <koolzz@fb.com>
  • Loading branch information
koolzz committed Sep 8, 2020
1 parent 462260f commit 43f4622
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
8 changes: 6 additions & 2 deletions lte/gateway/c/session_manager/LocalSessionManagerHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,8 @@ void LocalSessionManagerHandlerImpl::send_create_session(
MLOG(MINFO) << "Successfully initialized new session " << sid
<< " in sessiond for subscriber " << imsi
<< " with default bearer id " << bearer_id;
add_session_to_directory_record(imsi, sid);
add_session_to_directory_record(imsi, sid,
cfg.common_context.msisdn());
} else {
MLOG(MINFO) << "Failed to initialize new session " << sid
<< " in sessiond for subscriber " << imsi
Expand Down Expand Up @@ -394,12 +395,15 @@ void LocalSessionManagerHandlerImpl::send_local_create_session_response(
}

void LocalSessionManagerHandlerImpl::add_session_to_directory_record(
const std::string& imsi, const std::string& session_id) {
const std::string& imsi, const std::string& session_id,
const std::string& msisdn) {
UpdateRecordRequest request;
request.set_id(imsi);
auto update_fields = request.mutable_fields();
std::string session_id_key = "session_id";
update_fields->insert({session_id_key, session_id});
std::string msisdn_id_key = "msisdn";
update_fields->insert({msisdn_id_key, msisdn});
directoryd_client_->update_directoryd_record(
request, [this, imsi](Status status, Void) {
if (!status.ok()) {
Expand Down
3 changes: 2 additions & 1 deletion lte/gateway/c/session_manager/LocalSessionManagerHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ class LocalSessionManagerHandlerImpl : public LocalSessionManagerHandler {
std::string convert_mac_addr_to_str(const std::string& mac_addr);

void add_session_to_directory_record(
const std::string& imsi, const std::string& session_id);
const std::string& imsi, const std::string& session_id,
const std::string& msisdn);

/**
* handle_create_session_cwf handles a sequence of actions needed for the
Expand Down

0 comments on commit 43f4622

Please sign in to comment.