Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add PFPC User ID to Session Establishment Request #357

Merged
merged 1 commit into from
Apr 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion apps/ergw_core/src/ergw_pfcp_context.erl
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ session_establishment_request(Handler, PCC, PCtx0,
?LOG(debug, "CtxPending: ~p~n", [Ctx]),

IEs0 = pfcp_pctx_update(PCtx2, PCtx0, SxRules),
IEs = update_m_rec(ergw_pfcp:f_seid(PCtx2, CntlNode), IEs0),
IEs1 = update_m_rec(ergw_pfcp:f_seid(PCtx2, CntlNode), IEs0),
IEs = pfcp_user_id(Ctx, IEs1),
?LOG(debug, "IEs: ~p~n", [IEs]),

Req = #pfcp{version = v1, type = session_establishment_request, ie = IEs},
Expand Down Expand Up @@ -630,6 +631,12 @@ pfcp_pctx_update(#pfcp_ctx{up_inactivity_timer = UPiTnew} = PCtx,
pfcp_pctx_update(_, _, IEs) ->
IEs.

pfcp_user_id(#context{imsi = IMSI, imei = IMEI, msisdn = MSISDN}, IEs) ->
IEs#{user_id => #user_id{imsi = IMSI, imei = IMEI, msisdn = MSISDN}};
pfcp_user_id(_, IEs) ->
%% TDF contexts do not have user id information
IEs.

handle_validity_time(_ChargingKey,
#{'Update-Time-Stamp' := BaseTime, 'Validity-Time' := {BaseTime, Time}},
URR0, #pfcp_ctx{features = #up_function_features{vtime = 1}} = PCtx) ->
Expand Down
3 changes: 2 additions & 1 deletion apps/ergw_core/test/pgw_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1413,7 +1413,8 @@ simple_session_request(Config) ->
(_) ->false
end, ergw_test_sx_up:history('pgw-u01')),

?match_map(#{create_pdr => '_', create_far => '_', create_urr => '_'}, SER#pfcp.ie),
?match_map(#{user_id => '_', create_pdr => '_',
create_far => '_', create_urr => '_'}, SER#pfcp.ie),
#{create_pdr := PDRs0,
create_far := FARs0,
create_urr := URR
Expand Down