summaryrefslogtreecommitdiffstats
path: root/src/osmo_ss7_gtt.erl
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2011-04-02 18:15:04 +0200
committerHarald Welte <laforge@gnumonks.org>2011-04-02 18:15:04 +0200
commit7a321dbf0d6ec1262dc360fc786a3a7096cf9637 (patch)
treed031c3b4d8dbe79278ac7c325dfff70041cdb4f6 /src/osmo_ss7_gtt.erl
parent24a4924256431c9ef0b79b76283be48ca1964e39 (diff)
GTT: add generic 'apply' action
This GTT Action can be used to call a user-supplied callback funciton in case a GT Match was detected.
Diffstat (limited to 'src/osmo_ss7_gtt.erl')
-rw-r--r--src/osmo_ss7_gtt.erl10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/osmo_ss7_gtt.erl b/src/osmo_ss7_gtt.erl
index fb117d4..8f7e243 100644
--- a/src/osmo_ss7_gtt.erl
+++ b/src/osmo_ss7_gtt.erl
@@ -126,9 +126,13 @@ gtt_action(Gt, Action) when is_record(Gt, global_title), is_record(Action, gtt_a
Gt#global_title{phone_number = Header ++ NewDigits ++ Trailer};
% Execute a single action: Replac the numbering plan in the GT
-gtt_action(Gt,Action) when is_record(Gt, global_title), is_record(Action, gtt_act_repl_num_plan) ->
- NewNumPlan = Action#gtt_act_repl_num_plan.numbering_plan,
- Gt#global_title{numbering_plan = NewNumPlan}.
+gtt_action(Gt, #gtt_act_repl_num_plan{numbering_plan = NewNumPlan}) when is_record(Gt, global_title) ->
+ Gt#global_title{numbering_plan = NewNumPlan};
+
+% Execute a single 'generic purpose' action that will call apply/2
+gtt_action(Gt, #gtt_act_apply{funct = Funct, args = Args}) when is_record(Gt, global_title) ->
+ apply(Funct, Args).
+
% appliy a list of GTT actions to a Global Title
apply_gtt_actions(Gt, []) when is_record(Gt, global_title) ->