pespin has submitted this change. ( https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/36339?usp=email )
Change subject: epdg: Tx SWm RAA from within epdg_ue_fsm ......................................................................
epdg: Tx SWm RAA from within epdg_ue_fsm
Since previous commits, it is possible to transmit SWm messages from within the epdg_ue_fsm, so do it now.
Change-Id: Ib31cf1ab4c7e10c910e54b9908b62eee26ee3cba --- M src/epdg_diameter_swm.erl M src/epdg_ue_fsm.erl 2 files changed, 15 insertions(+), 14 deletions(-)
Approvals: Jenkins Builder: Verified pespin: Looks good to me, approved
diff --git a/src/epdg_diameter_swm.erl b/src/epdg_diameter_swm.erl index bf7c0b1..cdf572f 100644 --- a/src/epdg_diameter_swm.erl +++ b/src/epdg_diameter_swm.erl @@ -147,14 +147,7 @@ Imsi = list_to_binary(ImsiStr), case epdg_ue_fsm:get_pid_by_imsi(Imsi) of Pid when is_pid(Pid) -> - case epdg_ue_fsm:received_swm_reauth_request(Pid) of - ok -> - DiaResultCode = 2001, %% SUCCESS - aaa_diameter_swm:rx_reauth_answer(ImsiStr, DiaResultCode); - _ -> - DiaResultCode = 5012, %% UNABLE_TO_COMPLY - aaa_diameter_swm:rx_reauth_answer(ImsiStr, DiaResultCode) - end; + epdg_ue_fsm:received_swm_reauth_request(Pid); undefined -> lager:notice("SWm Rx RAR: unknown swm-session ~p", [Imsi]), DiaResultCode = 5002, %% UNKNOWN_SESSION_ID diff --git a/src/epdg_ue_fsm.erl b/src/epdg_ue_fsm.erl index 062083b..8a0c16e 100644 --- a/src/epdg_ue_fsm.erl +++ b/src/epdg_ue_fsm.erl @@ -341,14 +341,12 @@
state_authenticated({call, From}, received_swm_reauth_request, Data) -> lager:info("ue_fsm state_authenticated event=received_swm_reauth_request, ~p~n", [Data]), + epdg_diameter_swm:tx_reauth_answer(Data#ue_fsm_data.imsi, #epdg_dia_rc{result_code = 2001}), % TODO: 3GPP TS 29.273 7.1.2.5.1: % Upon receiving the re-authorization request, the ePDG shall immediately invoke the authorization procedure % specified in 7.1.2.2 for the session indicated in the request. This procedure is based on the Diameter % commands AA-Request (AAR) and AA-Answer (AAA) specified in IETF RFC 4005 [4]. Information % element contents for these messages are shown in tables 7.1.2.2.1/1 and 7.1.2.2.1/2. - % - % This is done synchronously for now when returning from call: - %%epdg_diameter_swm:tx_reauth_answer(Data#ue_fsm_data.imsi, #epdg_dia_rc{result_code = 2001}), {keep_state, Data, [{reply,From,ok}]};
state_authenticated({call, From}, purge_ms_request, Data) -> @@ -422,14 +420,12 @@
state_active({call, From}, received_swm_reauth_request, Data) -> lager:info("ue_fsm state_active event=received_swm_reauth_request, ~p~n", [Data]), + epdg_diameter_swm:tx_reauth_answer(Data#ue_fsm_data.imsi, #epdg_dia_rc{result_code = 2001}), % TODO: 3GPP TS 29.273 7.1.2.5.1: % Upon receiving the re-authorization request, the ePDG shall immediately invoke the authorization procedure % specified in 7.1.2.2 for the session indicated in the request. This procedure is based on the Diameter % commands AA-Request (AAR) and AA-Answer (AAA) specified in IETF RFC 4005 [4]. Information % element contents for these messages are shown in tables 7.1.2.2.1/1 and 7.1.2.2.1/2. - % - % This is done synchronously for now when returning from call: - %%epdg_diameter_swm:tx_reauth_answer(Data#ue_fsm_data.imsi, #epdg_dia_rc{result_code = 2001}), {keep_state, Data, [{reply,From,ok}]};
state_active({call, From}, purge_ms_request, Data) ->