From 7a321dbf0d6ec1262dc360fc786a3a7096cf9637 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sat, 2 Apr 2011 18:15:04 +0200 Subject: 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. --- src/osmo_ss7_gtt.erl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/osmo_ss7_gtt.erl') 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) -> -- cgit v1.2.3