epdg: Do CEAI CancelLocationReq upon rx of S2B Delete Bearer Req

Change-Id: Iee20619902db74da4b8cec5ba767f7c5c9bb3907
This commit is contained in:
Pau Espin 2024-02-05 20:13:45 +01:00
parent 660a6edd20
commit 9fd737e1a4
2 changed files with 27 additions and 1 deletions

View File

@ -244,6 +244,7 @@ state_authenticated({call, From}, purge_ms_request, Data) ->
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}]};

View File

@ -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 @@ handle_cast({purge_ms_response, {Imsi, Result}}, State0) ->
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 @@ handle_info({ipa, Socket, ?IPAC_PROTO_EXT_GSUP, GsupMsgRx = #{message_type := pu
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 @@ purge_ms_response(Imsi, Result) ->
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
%% ------------------------------------------------------------------