pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/35865?usp=email )
Change subject: epdg: Do CEAI CancelLocationReq upon rx of S2B Delete Bearer Req ......................................................................
epdg: Do CEAI CancelLocationReq upon rx of S2B Delete Bearer Req
Change-Id: Iee20619902db74da4b8cec5ba767f7c5c9bb3907 --- M src/epdg_ue_fsm.erl M src/gsup_server.erl 2 files changed, 36 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/erlang/osmo-epdg refs/changes/65/35865/1
diff --git a/src/epdg_ue_fsm.erl b/src/epdg_ue_fsm.erl index 350a991..3d325a0 100644 --- a/src/epdg_ue_fsm.erl +++ b/src/epdg_ue_fsm.erl @@ -244,6 +244,7 @@
state_authenticated({call, From}, received_gtpc_delete_bearer_request, Data) -> lager:info("ue_fsm state_authenticated event=received_gtpc_delete_bearer_request, ~p~n", [Data]), + gsup_server:cancel_location_request(Data#ue_fsm_data.imsi), Data1 = Data#ue_fsm_data{tear_down_gsup_needed = false}, {next_state, state_wait_swm_session_termination_answer, Data1, [{reply,From,ok}]};
diff --git a/src/gsup_server.erl b/src/gsup_server.erl index 4d50fba..8659c95 100644 --- a/src/gsup_server.erl +++ b/src/gsup_server.erl @@ -62,7 +62,7 @@
-export([init/1, handle_call/3, handle_cast/2, handle_info/2]). -export([code_change/3, terminate/2]). --export([auth_response/2, lu_response/2, tunnel_response/2, purge_ms_response/2]). +-export([auth_response/2, lu_response/2, tunnel_response/2, purge_ms_response/2, cancel_location_request/1]).
% TODO: -spec dia_sip2gsup('SIP-Auth-Data-Item'()) -> #'GSUPAuthTuple'{}. dia_sip2gsup(#'SIP-Auth-Data-Item'{'SIP-Authenticate' = [Authenticate], 'SIP-Authorization' = [Authorization], @@ -201,6 +201,16 @@ State1 = delete_gsups_ue(Imsi, State0), {noreply, State1};
+% Our GSUP CEAI implementation for "IKEv2 Information Delete Request" +handle_cast({cancel_location_request, Imsi}, State) -> + lager:info("cancel_location_request for ~p~n", [Imsi]), + Socket = State#gsups_state.socket, + Resp = #{message_type => location_cancellation_req, + imsi => Imsi + }, + tx_gsup(Socket, Resp), + {noreply, State}; + handle_cast(Info, S) -> error_logger:error_report(["unknown handle_cast", {module, ?MODULE}, {info, Info}, {state, S}]), {noreply, S}. @@ -313,6 +323,16 @@ end, {noreply, State};
+% Our GSUP CEAI implementation for "IKEv2 Information Delete Response". +handle_info({ipa, Socket, ?IPAC_PROTO_EXT_GSUP, GsupMsgRx = #{message_type := location_cancellation_res, imsi := Imsi}}, State0) -> + lager:info("GSUP: Rx ~p~n", [GsupMsgRx]), + UE = find_gsups_ue_by_imsi(Imsi, State0), + case UE of + #gsups_ue{imsi = Imsi} -> State1 = delete_gsups_ue(Imsi, State0); + undefined -> State1 = State0 + end, + {noreply, State1}; + handle_info(Info, S) -> error_logger:error_report(["unknown handle_info", {module, ?MODULE}, {info, Info}, {state, S}]), {noreply, S}. @@ -339,6 +359,11 @@ lager:info("purge_ms_response(~p): ~p~n", [Imsi, Result]), gen_server:cast(?SERVER, {purge_ms_response, {Imsi, Result}}).
+% Our GSUP CEAI implementation for "IKEv2 Information Delete Request" +cancel_location_request(Imsi) -> + lager:info("cancel_location_request(~p): ~p~n", [Imsi]), + gen_server:cast(?SERVER, {cancel_location_request, Imsi}). + %% ------------------------------------------------------------------ %% Internal Function Definitions %% ------------------------------------------------------------------