aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2011-03-31 09:40:44 +0200
committerHarald Welte <laforge@gnumonks.org>2011-03-31 09:40:44 +0200
commiteea20e1e821e0300809c4a5ed652e9c3cd0d455b (patch)
tree4f6a4dd9c31f27ccbb6ea2ff37dbdc5b7c482685
parente95bfe9a978f6e8fd5cfbf2ac3393e2c73bae723 (diff)
Use lists:keysearch() instead of lists:keyfind() for R12A compat
Also, print a message if we actually rewrite any phase
-rw-r--r--src/mgw_nat_act_vfuk_onw.erl7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mgw_nat_act_vfuk_onw.erl b/src/mgw_nat_act_vfuk_onw.erl
index 8f6cd39..a1dc984 100644
--- a/src/mgw_nat_act_vfuk_onw.erl
+++ b/src/mgw_nat_act_vfuk_onw.erl
@@ -52,15 +52,16 @@ mangle_map_camel_phase(from_stp, _Path, MapDec) ->
MapDec;
mangle_map_camel_phase(from_msc, Path, MapDec) ->
% Resolve the Global Title of the SCCP Called Addr
- #sccp_msg{parameters = SccpPars} = lists:keyfind(sccp_msg, 1, Path),
+ {value, #sccp_msg{parameters = SccpPars}} = lists:keysearch(sccp_msg, 1, Path),
CalledAddr = proplists:get_value(called_party_addr, SccpPars),
#global_title{phone_number = PhoneNum} = CalledAddr#sccp_addr.global_title,
PhoneNumInt = osmo_util:digit_list2int(PhoneNum),
{ok, CamelPatchTbl} = application:get_env(mgw_nat, camel_phase_patch_table),
- case lists:keyfind(PhoneNumInt, 1, CamelPatchTbl) of
+ case lists:keysearch(PhoneNumInt, 1, CamelPatchTbl) of
false ->
MapDec;
- { _Num, PhaseL } ->
+ {value, { _Num, PhaseL }} ->
+ io:format("Rewriting Camel Phase List to ~p, GT ~p~n", [PhaseL, PhoneNumInt]),
osmo_util:tuple_walk(MapDec, fun camelph_twalk_cb/3, [PhaseL])
end.