summaryrefslogtreecommitdiffstats
path: root/TCAP
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2012-01-30 23:34:53 +0100
committerHarald Welte <laforge@gnumonks.org>2012-01-30 23:34:53 +0100
commitf43bffe4058668fecabefcc575aa6fefec3df460 (patch)
tree4a436d402c79e6c0591a90302deec18ba45e8351 /TCAP
parent8d7b02530f52300f08863cbf3e29563e05e0a99b (diff)
DHA: handle TR-END.indication from TSL
Diffstat (limited to 'TCAP')
-rw-r--r--TCAP/src/ITU/tcap_dha_fsm.erl35
1 files changed, 34 insertions, 1 deletions
diff --git a/TCAP/src/ITU/tcap_dha_fsm.erl b/TCAP/src/ITU/tcap_dha_fsm.erl
index ba09a3d..efddf46 100644
--- a/TCAP/src/ITU/tcap_dha_fsm.erl
+++ b/TCAP/src/ITU/tcap_dha_fsm.erl
@@ -646,7 +646,40 @@ active({'TC', 'END', request, EndParms}, State) when is_record(EndParms, 'TC-END
gen_server:cast(State#state.cco, 'request-components'),
%% Process components
{next_state, wait_for_end_components, State}
- end.
+ end;
+
+%% reference: Figuer A.5/Q774 (sheet 10 of 11)
+%% TR-END indication from TSL
+active({'TR', 'END', indication, EndParms}, State) when is_record(EndParms, 'TR-END') ->
+ UserData = EndParms#'TR-END'.userData,
+ if
+ UserData#'TR-user-data'.dialoguePortion /= asn1_NOVALUE ->
+ % discard components
+ % TC-P-ABORT.ind to TCU
+ Components = undefined,
+ ComponentsPresent = false;
+ UserData#'TR-user-data'.componentPortion /= asn1_NOVALUE ->
+ case 'TC':decode('Components', UserData#'TR-user-data'.componentPortion) of
+ [] = Components -> ComponentsPresent = false;
+ Components -> ComponentsPresent = true
+ end;
+ true ->
+ Components = undefined,
+ ComponentsPresent = false
+ end,
+ case ComponentsPresent of
+ true ->
+ %% Components to CHA
+ gen_server:cast(State#state.cco, {components, Components});
+ false ->
+ ok
+ end,
+ %% Dialogue terminated to CHA
+ gen_server:cast(State#state.cco, 'dialogue-terminated'),
+ %% Free dialogue ID
+ {stop, normal, State}.
+
+
%% reference: Figure A.5 bis/Q.774
%% reference: Figure A.5/Q.774 (sheet 2 of 11)